38
Model API Tekla Open API: Modeling Tools & Plug-Ins

Introduction to Tekla Open API - tips and FAQ

  • Upload
    others

  • View
    48

  • Download
    1

Embed Size (px)

Citation preview

Page 1: Introduction to Tekla Open API - tips and FAQ

Model API

Tekla Open API: Modeling Tools & Plug-Ins

Page 2: Introduction to Tekla Open API - tips and FAQ

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

Page 3: Introduction to Tekla Open API - tips and FAQ

Structure of the Model API

Tekla Open API: Overview & Getting Started3

Page 4: Introduction to Tekla Open API - tips and FAQ

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

Page 5: Introduction to Tekla Open API - tips and FAQ

Model API TipsTekla Open API: Modeling Tools & Plug-Ins14

Page 6: Introduction to Tekla Open API - tips and FAQ

Things to Know

§ GetCurrentUser()§ OBB Class

15

Page 7: Introduction to Tekla Open API - tips and FAQ

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

Page 8: Introduction to Tekla Open API - tips and FAQ

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

Page 9: Introduction to Tekla Open API - tips and FAQ

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

Page 10: Introduction to Tekla Open API - tips and FAQ

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

Page 11: Introduction to Tekla Open API - tips and FAQ

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

Page 12: Introduction to Tekla Open API - tips and FAQ

AutoFetch Property

§ New static AutoFetch property in ModelObjectEnumeratorand DrawingObjectEnumerator which increases theenumeration speed significantly.

Tekla Open API: Modeling Tools & Plug-Ins21

Page 13: Introduction to Tekla Open API - tips and FAQ

Bolt Catalog Items

Tekla Open API: Modeling Tools & Plug-Ins22

Page 14: Introduction to Tekla Open API - tips and FAQ

Profile Catalog Items

Tekla Open API: Modeling Tools & Plug-Ins23

Page 15: Introduction to Tekla Open API - tips and FAQ

Component Catalog Items

Tekla Open API: Modeling Tools & Plug-Ins24

Page 16: Introduction to Tekla Open API - tips and FAQ

Frequently Asked QuestionsTekla Open API: Modeling Tools & Plug-Ins25

Page 17: Introduction to Tekla Open API - tips and FAQ

Construction Circle

Tekla Open API: Modeling Tools & Plug-Ins26

Page 18: Introduction to Tekla Open API - tips and FAQ

Construction Point

Tekla Open API: Modeling Tools & Plug-Ins27

Page 19: Introduction to Tekla Open API - tips and FAQ

Part Cut

28

Tekl

aO

pen

API:

Mod

elin

gToo

ls&

Plug

-Ins

Page 20: Introduction to Tekla Open API - tips and FAQ

Part Add

Tekl

aO

pen

API:

Mod

elin

gToo

ls&

Plug

-Ins

29

Page 21: Introduction to Tekla Open API - tips and FAQ

Unit Conversion

§ Tekla.Structures.Datatype.dll§ Form control binding

Tekla Open API: Modeling Tools & Plug-Ins30

Page 22: Introduction to Tekla Open API - tips and FAQ

Unit Conversion

§ Converting single strings to distance objects

Tekla Open API: Modeling Tools & Plug-Ins31

Page 23: Introduction to Tekla Open API - tips and FAQ

Finding Connected objects

Tekl

aO

pen

API:

Mod

elin

gToo

ls&

Plug

-Ins

32

Page 24: Introduction to Tekla Open API - tips and FAQ

Creating Assemblies

§ Assembly / CastUnit

33

Tekl

aO

pen

API:

Mod

elin

gToo

ls&

Plug

-Ins

Page 25: Introduction to Tekla Open API - tips and FAQ

Traversing Assemblies

Tekl

aO

pen

API:

Mod

elin

gToo

ls&

Plug

-Ins

34

Page 26: Introduction to Tekla Open API - tips and FAQ

§ MatrixFactory.Rotate(double value, Vector direction)

Rotating Objects

Tekl

aO

pen

API:

Mod

elin

gToo

ls&

Plug

-Ins

35

Page 27: Introduction to Tekla Open API - tips and FAQ

Getting Desired Part Faces

36

Tekl

aO

pen

API:

Mod

elin

gToo

ls&

Plug

-Ins

§ Contour plate, local top face

Page 28: Introduction to Tekla Open API - tips and FAQ

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

Page 29: Introduction to Tekla Open API - tips and FAQ

Getting Component Children

§ You can get objects created by components in the model

Tekla Open API: Modeling Tools & Plug-Ins38

Page 30: Introduction to Tekla Open API - tips and FAQ

Part Cut

Tekla Open API: Modeling Tools & Plug-Ins39

Page 31: Introduction to Tekla Open API - tips and FAQ

Part Add

Tekla Open API: Modeling Tools & Plug-Ins40

Page 32: Introduction to Tekla Open API - tips and FAQ

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

Page 33: Introduction to Tekla Open API - tips and FAQ

B-rep Parts Through API

Tekla Open API: Modeling Tools & Plug-Ins42

Page 34: Introduction to Tekla Open API - tips and FAQ

Picking FacesTekla Open API: Modeling Tools & Plug-Ins43

Page 35: Introduction to Tekla Open API - tips and FAQ

Picker Class

Tekla Open API: Modeling Tools & Plug-Ins44

Page 36: Introduction to Tekla Open API - tips and FAQ

Picker Input

Tekla Open API: Modeling Tools & Plug-Ins45

Page 37: Introduction to Tekla Open API - tips and FAQ

Getting Face Input from User

Tekla Open API: Modeling Tools & Plug-Ins46

Page 38: Introduction to Tekla Open API - tips and FAQ

Thank YouTekla Open API: Modeling Tools & Plug-Ins47