The trick is to use to the drawing’s “PartIdentifier” to select the relevant object in the model space.
Once you’ve done that, you can query the model object for whatever you want.
Here is a code sample I’ve extracted from one of our Tekla API Applications. The basic steps:
- Get the Drawing
- Get the part identifier
- Select it in the model
SinglePartDrawing singlePartDrawing = (SinglePartDrawing)drawing;
Tekla.Structures.Model.ModelObject modelObject = model.SelectModelObject(singlePartDrawing.PartIdentifier);
Tekla.Structures.Model.Part part = (Tekla.Structures.Model.Part)modelObject;
Leave a Reply