logo资料库

tekla。net开发指导.pdf

第1页 / 共44页
第2页 / 共44页
第3页 / 共44页
第4页 / 共44页
第5页 / 共44页
第6页 / 共44页
第7页 / 共44页
第8页 / 共44页
资料共44页,剩余部分请下载后查看
TeklaP POpen API
Developer's Guide
Contents
Introduction
What is Tekla Open API?
Where to utilize the Tekla Open API?
Automate routine tasks
Integrate Tekla Structures into your own process, workflow, and software
Develop additional functionality to extend and enhance Tekla Structures
Where to find support?
Open API discussion forum
About Assemblies
Introduction
Common principles
Tekla.Structures.dll
Tekla.Structures.Model.dll
Tekla.Structures.Drawings.dll
Tekla.Structures.Plugins.dll
Tekla.Structures.Analysis.dll
Tekla.Structures.Catalogs.dll
Tekla.Structures.Datatype.dll
Tekla.Structures.Dialog.dll
Applications
Introduction
Getting started
Example: ask user to pick objects
Example: go through objects in the model or a drawing
ApplicationFormBase
Plug-ins
Introduction
Basic steps for creating a plug-in
Model plug-ins
Mandatory fields in the model plug-in
Dialog design with Windows Forms
Class definition
Naming the plug-in
Data connections
Passing Data
AttributeName
AttributeTypeName
BindPropertyName
IsFilter
Default values
Limitation
Dialog design with INP
Naming the plug-in
Adding a thumbnail image
Special notices and reminders
A step-by-step example
Drawing plug-ins
Mandatory fields in the drawing plug-in
Dialog design with Windows Forms
StructuresData
Constructor
DefineInput()
Run(List inputs)
Adding a drawing plug-in to Tekla Structures
A step-by-step example
Notes for using Tekla Open API
TransformationPlane class
MatrixFactory class
CoordinateSystem class
Point class
Offset class
Picker class
Solid class
Handling exceptions in applications/plugins
User Interface Controls
Catalog custom controls
BoltCatalog
ComponentCatalog
Localization of strings
Localization of plug-in name in Component Catalog
Localization of plug-in or application strings
Editing
Multiple lines
Microsoft Word and ellipsis
Step-by-step instructions
Message box localization
Tekla Open API Developer's Guide Tekla Structures 18.0 March 2012 Copyright © 2012 Tekla Corporation
© 2012 Tekla Corporation and its licensors. All rights reserved. This Software Manual has been developed for use with the referenced Software. Use of the Software, and use of this Software Manual are governed by a License Agreement. Among other provisions, the License Agreement sets certain warranties for the Software and this Manual, disclaims other warranties, limits recoverable damages, defines permitted uses of the Software, and determines whether you are an authorized user of the Software. Please refer to the License Agreement for important obligations and applicable limitations and restrictions on your rights. In addition, this Software Manual is protected by copyright law and by international treaties. Unauthorized reproduction, display, modification, or distribution of this Manual, or any portion of it, may result in severe civil and criminal penalties, and will be prosecuted to the full extent permitted by law. Tekla is a trademark of Tekla Corporation. Tekla is a registered trademark of Tekla Corporation in the European Union, the United States, and in several other countries. Tekla Structures, Xcity, Xengineer, Xpipe, Xroad, Xstreet, Xpower, Xsteel, and Xstreet are either registered trademarks or trademarks of Tekla Corporation in the European Union, the United States, and/or other countries. Other product and company names mentioned in this Manual are or may be trademarks of their respective owners. By referring to a third-party product or brand, Tekla does not intend to suggest an affiliation with or endorsement by such third party and disclaims any such affiliation or endorsement, except where otherwise expressly stated. Portions of this software: D-Cubed 2D DCM © 2008 Siemens Product Lifecycle Management Software III (GB) Ltd. All rights reserved. EPM toolkit © 1995-2004 EPM Technology a.s., Oslo, Norway. All rights reserved. XML parser © 1999 The Apache Software Foundation. All rights reserved. Project Data Control Library © 2006 - 2007 DlhSoft. All rights reserved. DWGdirect, DGNdirect and OpenDWG Toolkit/Viewkit libraries © 1998-2005 Open Design Alliance. All rights reserved. FLEXnet Copyright © 2006 Acresso Software Inc. All Rights Reserved. This product contains proprietary and confidential technology provided by and owned byAcresso Software Inc. Of Chicago, Illinois, USA. Any use, copying, publication, distribution, display, modification, or transmission of such technology in whole or in part in any form or by any means without the prior express written permission of Acresso Software Inc. is strictly prohibited. Except where expressly provided by Acresso Software Inc. in writing, possession of this technology shall not be construed to confer any license or rights under any of Acresso Software´s intellectual property rights, whether by estoppel, implication, or otherwise. Elements of the software described in this Manual may be the subject of pending patent applications in the European Union and/or other countries.
Contents Tekla Open API ........................................................................................................................ 1 Developer's Guide .................................................................................................................................... 1 Contents .................................................................................................................................... i Introduction ............................................................................................................................. 1 ......................................................................................................................... 1 ...................................................................................................... 1 ............................................................................................................................. 2 What is Tekla Open API? Where to utilize the Tekla Open API? Where to find support? About Assemblies ................................................................................................................... 3 ................................................................................................................................................ 3 ................................................................................................................................... 3 ................................................................................................................................... 3 ........................................................................................................................ 4 ................................................................................................................... 4 ...................................................................................................................... 4 .................................................................................................................... 5 ................................................................................................................... 5 ................................................................................................................... 5 ........................................................................................................................ 5 Introduction Common principles Tekla.Structures.dll Tekla.Structures.Model.dll Tekla.Structures.Drawings.dll Tekla.Structures.Plugins.dll Tekla.Structures.Analysis.dll Tekla.Structures.Catalogs.dll Tekla.Structures.Datatype.dll Tekla.Structures.Dialog.dll Applications ............................................................................................................................. 7 ................................................................................................................................................ 7 ........................................................................................................................................... 7 ................................................................................................................................ 9 Introduction Getting started ApplicationFormBase Plug-ins .................................................................................................................................. 13 .............................................................................................................................................. 13 ........................................................................................................... 13 ......................................................................................................................................... 14 Introduction Basic steps for creating a plug-in Model plug-ins TEKLA OPEN API DEVELOPER'S GUIDE
Mandatory fields in the model plug-in Dialog design with Windows Forms Dialog design with INP Adding a thumbnail image Special notices and reminders A step-by-step example ......................................................................................... 14 ............................................................................................ 14 ................................................................................................................. 19 ........................................................................................................... 20 .................................................................................................... 20 ............................................................................................................... 20 ..................................................................................................................................... 23 ...................................................................................... 23 ............................................................................................ 23 ............................................................................. 24 ............................................................................................................... 24 Mandatory fields in the drawing plug-in Dialog design with Windows Forms Adding a drawing plug-in to Tekla Structures A step-by-step example Drawing plug-ins Notes for using Tekla Open API TransformationPlane class MatrixFactory class CoordinateSystem class Point class Offset class Picker class Solid class Handling exceptions in applications/plugins ......................................................................................... 29 .......................................................................................................... 29 ...................................................................................................................... 29 .............................................................................................................. 30 .................................................................................................................................... 30 ................................................................................................................................... 30 .................................................................................................................................. 30 .................................................................................................................................... 31 ............................................................................... 31 User Interface Controls ........................................................................................................ 32 .............................................................................................................. 33 ................................................................................................................................... 34 ...................................................................................................................... 35 Catalog custom controls BoltCatalog ComponentCatalog Localization of strings .......................................................................................................... 37 .................................................................. 37 ............................................................................... 38 Localization of plug-in name in Component Catalog Localization of plug-in or application strings ii TEKLA OPEN API DEVELOPER'S GUIDE
Introduction What is Tekla Open API? Interface is a common boundary between two entities. Tekla Structures user interface enables human users to communicate with the software. Tekla’s Open API, Application Programming Interface, facilitates interaction between Tekla Structures and other software. The Tekla Open API, also known as the .NET API, provides an interface for third party applications to interact with model and drawing objects in Tekla Structures. It also allows the creation of plug-ins. The Tekla Open API 18.0 is developed on the Microsoft .NET Framework version 4.0 Full Profile. Where to utilize the Tekla Open API? Tekla Open API can be utilized with variety of tools. Tekla Open API enables users and vendors to for example: Automate routine tasks By recording and running user interface actions it is possible to automate routine tasks such as creating daily reports. With the Tekla Open API you can automate for example the creation of modeling and drawing objects. These creation tools are typically frequently needed in projects and can for instance: • Create basic structures to model such as type base hall • • Automate creation of dimensions for GA drawing based on model information Insert typical AutoCAD details to drawings based on drawing information TEKLA OPEN API DEVELOPER'S GUIDE Introduction 1
Integrate Tekla Structures into your own process, workflow, and software Tekla Open API can be utilized in integration of Tekla Structures to other software. Information can be transferred between Tekla Structures model and drawing database and other software used in your office such as: • Office tools • A&D • MIS & ERP With the API you can for instance get full geometric information for CNC. Develop additional functionality to extend and enhance Tekla Structures It is possible to create tools which will add functionality or information to Tekla Structures through the API such as: • RFI (Request for Information) management • New connection creator between parts • Model check and correction tools • Erection and site planning tools Where to find support? Extranet is the Tekla’s channel of supporting .NET developers. From there you can find the Tekla Open API page with downloads section as well as the Open API discussion forum. Start-up package The Start-up package, that can be downloaded from the Extranet’s API page, is a good starting point for learning and developing your first application or plug-in. Open API discussion forum Support in the forum is based on C#. It contains up-to-date information and answers to specific questions about using the API. Besides that forum collects also feature requests and bugs. Before posting your question to the forum it might be useful to use the Search functionality provided by the forum – quite often your question have been answered already. And please do not hesitate to answer yourself if you can be of help to others! Note that the forum is not meant for general questions about .NET and programming, or Microsoft’s or other 3rd party application’s APIs. 2 TEKLA OPEN API DEVELOPER'S GUIDE Introduction
About Assemblies Introduction Assemblies and reference manual can be found in the folders “nt\bin\plugins”, “nt\bin\dialogs” and “nt\help”, respectively, in each version of Tekla Structures. All assemblies except Tekla.Structures.Plugins are registered to GAC (Global Assembly Cache). Common principles All object classes in the API have common methods for manipulating objects such as: Insert() for creating new object instance • Select() for object selection from database or from interface • • Modify() for modifying object in database or interface • Delete() for deleting object from database or interface All object classes in API have been designed with following principles: • Object initialization is similar to object creation from user interface of Tekla Structures. As example Beam is initialized by giving two positions in constructor-method. • Field naming in object classes follows dialog field names (in English language) as much as possible. Tekla.Structures.dll This assembly contains some basic common types shared by model and drawings. TEKLA OPEN API DEVELOPER'S GUIDE About Assemblies 3
Tekla.Structures.Model.dll Model assembly consists of classes and methods used when connecting and manipulating objects in Tekla Structures model database: • Model object classes such as Beam, ContourPlate, BoltArray, Load, Component, etc. • Methods to manipulate model objects, including basic object operations like copy, move, combine and split • Methods to enumerate model objects • Methods such as picking (dynamic selection) and selection of model views • Analysis classes for accessing the analysis results database • Classes related to clash checking Besides Tekla.Structures.Model namespace this assembly contains sub-namespaces for ClashChecker, Collaboration, History, Operations and UI. Tekla.Structures.Drawings.dll Drawings assemblies are recommended to be used to edit the drawings, not for drawing creation. This assembly consists of classes and methods used when connecting and manipulating objects in Tekla Structures drawing database: • Drawing object classes such as Drawing, View, Part, Text, Line. • Methods to manipulate and enumerate drawing objects. • Methods such as picking (dynamic selection) and selection for drawing views. This assembly contains four namespaces: Tekla.Structures.Drawings, Tekla.Structures.Drawings.UI, Tekla.Structures.Drawings.Automation, and Tekla.Structures.Drawings.Tools. Tekla.Structures.Plugins.dll Plugins assembly consists of classes and methods used when defining .NET component tools (plug-ins) to Tekla Structures. The functionality of a plug-in is similar to a generic component tool created using Developer Kit. The definition contains: • User interface • Input management 4 TEKLA OPEN API DEVELOPER'S GUIDE About Assemblies
分享到:
收藏