Tekla - "open" api

Tekla Open API: How to access a Tekla Model Object from the Equivalent Object in a Drawing?

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;


Comments

Leave a Reply

Your email address will not be published. Required fields are marked *