One can utilize mdlModelRef_getLinkageHolderElement() and mdlModelRef_setLinkageHolderElement() to add/update a linkage to a model that can later be used/placed as a cell and that cell will contain the linkage info without having to do anything else. Can the same be true for XML Instance linkages ? I want to assign an XML instance occurance to a model in a cell library and have that XML linkage carry-over such that when the model is placed as a cell, it contains the XML linkage. Can that be done using the above two functions? Also, if that can be done, does the XML schema that is inserted into the cell library in order to add the XML linkage automatically get inserted into the current model when placing the cell?
Thanks,
Bruce
2-6957
From my experience and expectation this will (currently) not work with XML linkages.
'Normal' user linkages are in fact part of the geometry. They reside IN a special part of each element. In case of a library cell, those linkages (set via linkage holder) are in the model header which becomes (with very little changes - if even) the cell header and so can remain there.
XML linkages are attached TO an element, in fact they remain in a table and where assigned to an element by its model- and element-id. As you should know an element becomes it's id when it's placed. And as far as I know there is no mechanism to extract anything from a cell-model that becomes autmatically placed as an XML linkage.
But to be true it would be a nice idea, especially for EC linkages (which work the same way and are a special kind of XML attribs). You should file a CR therefore.
Michael
Unknown said:I want to assign an XML instance occurance to a model in a cell library
If you're talking EC Schema instances then I think you probably can. Mark Anderson showed an example at Euro DevCon 2012 where he attaches schema instance data to an element. I guess you can attach schema data to a model.
Where I think your idea becomes stuck is in cell placement. I have no idea whether a cell having schema instance data can be placed along with those data into a design model. I understand exactly why you want to do that, but only Bentley Systems can answer that question.
Regards, Jon Summers LA Solutions
Unknown said:Now available through Item Types ?
Yes: MicroStation CONNECT brings lots of possiblities to formal data definition (schemas) and extraction.
Item Types are a user-visible manifestation of some of those new capabilities.
bump..
Unknown said:bump..
Bump what?
Unknown said:I have no idea whether a cell having schema instance data can be placed along with those data into a design model. I understand exactly why you want to do that, but only Bentley Systems can answer that question.
So, Can a Cell with instance data be placed with the data into the model?
Unknown said:Can a Cell with instance data be placed with the data into the model?
Try this:
Keep in mind that this is the Programming Forum, and that the original question is about performing those steps programmatically.