Introduction to Tekla Open API - tips and FAQ
Transcript of Introduction to Tekla Open API - tips and FAQ
Model API
Tekla Open API: Modeling Tools & Plug-Ins
Tekla Open API - Model
§ Model API– Connect to a running Tekla Structures model– Create, modify, and delete model objects
§ Read and write object attributes§ Read and write user defined attributes§ Get report properties for objects
– Interact with the user§ Get currently selected objects§ Prompt user to pick objects and locations§ Select and highlight objects for the user
– Access catalogs (material, bolt, profile, etc.)– Create and manipulate model views
10/9/20172
TeklaStructures
TeklaStructures
MacroAPI
MacroAPI
DrawingAPI
DrawingAPI
Plug-inAPI
Plug-inAPI
ModelAPI
Structure of the Model API
Tekla Open API: Overview & Getting Started3
Tekla.Structures.Geometry3D
§ Geometric calculations and tests– Distance
§ Point to Point, Point to Line, Point to Plane– Parallel
§ Line to Line, Line to Plane, Plane to Plane§ Geometric constructions
– Intersection§ Line to Line, Line to Plane
– Projection§ Point to Line, Point to Plane, Line to Plane
§ Matrix§ Transformations from one coordinate system to another§ MatrixFactory for easy creation of matrixes
4
Model API TipsTekla Open API: Modeling Tools & Plug-Ins14
Things to Know
§ GetCurrentUser()§ OBB Class
15
Things to Know
§ Solid.IntersectAllFaces() allows use of high-accuracy solids.– Part.GetSolid(),– Solid.Intersect(LineSegment),– Solid.Intersect(Point, Point).
§ Rebar geometries fetched in deformed form by default.
16
Things to Know: Catalogs
§ Rebar catalog: Item export and import methods§ Mesh catalog: Item export and import methods§ Shape catalog: Export() method in ShapeItem class§ ImportShapes() method in CatalogHandler class§ Import from folder for:
– LibraryProfileItems,– ParametricProfileItems,– MaterialItems,– Custom components.
17
Getting profile item and user attributes
§ items = new CatalogHandler().GetLibraryProfileItems();§ aProfileItemUserParameters give list of user attributes§ aProfileItemParameters§ aProfileItemAnalysisParameters§ Type, name, Sketch & sketch info§ Export
18
Solid Class
§ Contains GetAllIntersectionPoints method that gets all theintersection points between the solid and a plane.Compared to the IntersectAllFaces method, it does notarrange the points into polygons, and is thus a lot faster.
§ Solid.SolidCreationTypeEnum.NORMAL_WITHOUT_WELDPREPS has been added to the part.GetSolid() method.
Tekla Open API: Modeling Tools & Plug-Ins19
ModelHistory Class§ Works with Tekla Model Sharing§ The following methods have been added:
– GetNotSharedObjects() - returns a list of objects created or modified sincethe last Sharing WriteOut or multi-user save.
– TakeModifications() - returns the modifications since the previous call andresets the modification stamp.
– GetModifications() - returns the modifications since the previous call of– TakeModifications() without resetting the modification stamp.
§ The following methods are obsolete:– GetModifiedObjects(), GetModifiedObjectsWithType(),– GetDeletedObjects(), GetDeletedObjectsWithType(),– GetCurrentModificationStamp()
Tekla Open API: Modeling Tools & Plug-Ins20
AutoFetch Property
§ New static AutoFetch property in ModelObjectEnumeratorand DrawingObjectEnumerator which increases theenumeration speed significantly.
Tekla Open API: Modeling Tools & Plug-Ins21
Bolt Catalog Items
Tekla Open API: Modeling Tools & Plug-Ins22
Profile Catalog Items
Tekla Open API: Modeling Tools & Plug-Ins23
Component Catalog Items
Tekla Open API: Modeling Tools & Plug-Ins24
Frequently Asked QuestionsTekla Open API: Modeling Tools & Plug-Ins25
Construction Circle
Tekla Open API: Modeling Tools & Plug-Ins26
Construction Point
Tekla Open API: Modeling Tools & Plug-Ins27
Part Cut
28
Tekl
aO
pen
API:
Mod
elin
gToo
ls&
Plug
-Ins
Part Add
Tekl
aO
pen
API:
Mod
elin
gToo
ls&
Plug
-Ins
29
Unit Conversion
§ Tekla.Structures.Datatype.dll§ Form control binding
Tekla Open API: Modeling Tools & Plug-Ins30
Unit Conversion
§ Converting single strings to distance objects
Tekla Open API: Modeling Tools & Plug-Ins31
Finding Connected objects
Tekl
aO
pen
API:
Mod
elin
gToo
ls&
Plug
-Ins
32
Creating Assemblies
§ Assembly / CastUnit
33
Tekl
aO
pen
API:
Mod
elin
gToo
ls&
Plug
-Ins
Traversing Assemblies
Tekl
aO
pen
API:
Mod
elin
gToo
ls&
Plug
-Ins
34
§ MatrixFactory.Rotate(double value, Vector direction)
Rotating Objects
Tekl
aO
pen
API:
Mod
elin
gToo
ls&
Plug
-Ins
35
Getting Desired Part Faces
36
Tekl
aO
pen
API:
Mod
elin
gToo
ls&
Plug
-Ins
§ Contour plate, local top face
Insert LayoutPoint plug-in
§ LayoutPoint is a plug-in that comes with Tekla Structuresinstallation.
§ You can insert new instances of any plug-in through API
Tekla Open API: Modeling Tools & Plug-Ins37
Getting Component Children
§ You can get objects created by components in the model
Tekla Open API: Modeling Tools & Plug-Ins38
Part Cut
Tekla Open API: Modeling Tools & Plug-Ins39
Part Add
Tekla Open API: Modeling Tools & Plug-Ins40
B-rep Parts Through API
§ Part Item§ Insert or edit B-rep type parts
– Insert,– Delete,– Modify,– SetPhase,– SetUserProperty,– normal base get
§ ShapeItem & ShapeItemEnumerator classes§ Enumeration & exporting shape geometry definitions§ Create B-rep objects utilizing shape definitions
Tekl
aO
pen
API:
Mod
elin
gToo
ls&
Plug
-Ins
41
B-rep Parts Through API
Tekla Open API: Modeling Tools & Plug-Ins42
Picking FacesTekla Open API: Modeling Tools & Plug-Ins43
Picker Class
Tekla Open API: Modeling Tools & Plug-Ins44
Picker Input
Tekla Open API: Modeling Tools & Plug-Ins45
Getting Face Input from User
Tekla Open API: Modeling Tools & Plug-Ins46
Thank YouTekla Open API: Modeling Tools & Plug-Ins47