Hi Marco,
please follow the forum best practices. Even when not crucial for this specific discussion, often it's required to specify exactly what version do you use (there have been 15 versions of MicroStation CE released so far), SDK version and Visual Studio version.
Also, to use Insert > Insert code every time any piece (even one line) of the code is posted, is highly recommended. To read code as plain text is annoying.
Marco Natali said:I have the descriptor of an element obtained with the following function:
Just for curiosity: Is it code you have migrated from some old application or is it newly written code? Because to use MSElementDescr should be avoided as much as possible in new code.
Marco Natali said:Using the following code I can get the type of object
Well, it works, but it's not good code in my opinion, because in fact it does not tell you "type of object", but that element is stored as a cell. But cell can be used as normal cell, grouped hole element, OleCel, SmartSolid element etc. And this check does not provide you this information. It's an advantage of new C++ API based on ElementHandlers, where abstraction is based on element (as used by users) and not persistence format.
Marco Natali said:Is there anything like this to get the cell name?
Searching MicroStation API documentation I found (very quickly, did you try it?) mdlCell_extractName function. I assume it should work in your situation.
With regards,
Jan
Bentley Accredited Developer: iTwin Platform - AssociateLabyrinth Technology | dev.notes() | cad.point
Marco Natali said:I hadn't noticed the feature you recommended, sorry, which is just what I needed
Use the This Answered My Question button to acknowledge Jan's reply!
Regards, Jon Summers LA Solutions