The MicroStationAPI and the DgnPlatformNet have a CreateSharedCellElement() method (as of Update 10). It creates an instance, or placement, of a shared cell element in a DGN model.
CreateSharedCellElement()
Why isn't there a C++ .NET similar method for creating instances of normal cells? Consider these existing methods:
CreateCellElement2
mdlCell_getElmDscr
Jan Ĺ legr said:when it's placed, to attach custom data (XAttributes, EC data etc.) in one transaction, so Undo will work as expected
That's a very good reason for wanting a built-in function (for all languages) to place a cell instance from the library.
The function call may hide a lot of activity under the water. For example, mdlCell_getElmDscr() not only reads a cell from a library, but also gets a set of tag definitions (if they exist). The programmer can attach those tag defs. as tag elements to the new cell instance, which is what MicroStation does.
mdlCell_getElmDscr()
We would like that new method to behave similarly, particularly with respect to Item Type instances attached to the cell model in the cell library. When the cell instance is created, the Item Types should be copied from the library and attached with element scope rather than model scope. See this idea.
Regards, Jon Summers LA Solutions
i know this post is old but i wanted to note that if you attach any item types to your cell or (elements in your cell) and have text fields to display the values of properties in that attached item type in your cel lib and then try to use CreateCellElement2 and add it to your model the cell will be placed but all the text fields that link to an item property are broken.
the only way i was able to get placing a cell from library to work was with key ins. this has been a pretty frustrating process to figure out how to simply place a cell from a cell library.
John Drsek said: i wanted to note that if you attach any item types to your cell or (elements in your cell) and have text fields to display the values of properties in that attached item type in your cel lib and then try to use CreateCellElement2 and add it to your model the cell will be placed but all the text fields that link to an item property are broken
Bentley Systems tell us that Tags are obsolete because Item Types are better. However, you've observed one area where Item Types cannot be used successfully as a replacement for Tags.
Please vote for this idea, whose implementation would go towards solving that problem.
Robert Hook said:I see your mention to be able to place existing from Cell library as normal. I will look into that aspect more. For now
Bump!
Jon Summers said:Why isn't there a C++ .NET similar method for creating instances of normal cells?
Following a suggestion by Yongan.Fu, I wrote a C# place cell tool that uses COM methods. The secret sauce is to have a C# class inherit from a VBA/COM interface, which makes the methods of that interface available in C#. The same secret sauce works for both normal and shared cells.
All is made clear in this article DgnPlatformNet: Place Cell. The article has a link where you can download the C# source code.
Answer Verified By: Jon Summers
Robert Hook
Its the later part of 2022 now and I still dont see a function to place a cell from cell library. is this ever going to be added? the question keeps coming up over and over, the demand seems pretty high for this
Robert Hook said:UPDATE: I see your mention to be able to place existing from Cell library as normal. I will look into that aspect more.
BUMP