SpaceClaim Developers Guide SpaceClaim Developers Guide API V14 Final February

SpaceClaim Developers Guide SpaceClaim Developers Guide API V14 Final February 12, 2015 Copyright © 2008-2015, SpaceClaim Corp. All rights reserved. Page 1 SpaceClaim Developers Guide Table of Contents 1 Introduction...................................................................................................................................................4 1.1 Purpose........................................................................................................................................................4 1.2 Programming Language...............................................................................................................................4 1.3 Conventions.................................................................................................................................................4 2 Overview........................................................................................................................................................5 2.1 Architecture.................................................................................................................................................5 2.2 Doc Objects..................................................................................................................................................6 2.3 Document Structure....................................................................................................................................6 2.4 Part Structure..............................................................................................................................................7 2.5 Drawing Sheet Structure..............................................................................................................................9 3 Documents and Doc Objects........................................................................................................................11 3.1 Overview....................................................................................................................................................11 3.2 Parent-Child Hierarchy...............................................................................................................................11 3.3 Parts and Components..............................................................................................................................12 3.4 Instances and Occurrences........................................................................................................................13 3.5 Occurrence Chains.....................................................................................................................................14 3.6 General Objects and Masters....................................................................................................................14 3.7 Originals and Masters................................................................................................................................14 3.8 Transforming to Master-Space..................................................................................................................14 3.9 Getting Occurrences..................................................................................................................................15 4 Application Integration................................................................................................................................16 4.1 Persistent Identifiers..................................................................................................................................16 4.2 Replacements............................................................................................................................................16 4.3 Update States............................................................................................................................................17 5 Storing Custom Data....................................................................................................................................18 5.1 Document Properties.................................................................................................................................18 5.2 Custom Attributes.....................................................................................................................................18 5.3 Attribute Propagation................................................................................................................................19 6 Identifying Objects in ACIS and Parasolid Files.............................................................................................20 6.1 Identifiers During Export............................................................................................................................20 6.2 Foreign Identifiers During Import and Export............................................................................................20 7 Geometry and Topology...............................................................................................................................21 7.1 Unbounded Geometry and Trimmed Objects............................................................................................21 7.2 Topology....................................................................................................................................................21 7.3 Doc Objects and Geometry........................................................................................................................22 7.4 Design Curves............................................................................................................................................22 7.5 Design Bodies............................................................................................................................................23 Copyright © 2008-2015, SpaceClaim Corp. All rights reserved. Page 2 SpaceClaim Developers Guide 7.6 Shape in General........................................................................................................................................24 8 Accuracy.......................................................................................................................................................25 8.1 Linear and Angular Resolution...................................................................................................................25 8.2 Comparing Lengths and Angles..................................................................................................................25 8.3 Comparing XYZ Objects..............................................................................................................................26 8.4 Comparing UV Objects...............................................................................................................................26 8.5 Comparing Geometry................................................................................................................................26 9 Units.............................................................................................................................................................27 9.1 System Units and User Units......................................................................................................................27 9.2 Outputting Values......................................................................................................................................27 9.3 Inputting Values.........................................................................................................................................27 9.4 Custom Conversions..................................................................................................................................27 10 Calling The API From Another Process........................................................................................................28 10.1 .NET Remoting.........................................................................................................................................28 10.2 Template Client Code..............................................................................................................................28 Copyright © 2008-2015, SpaceClaim Corp. All rights reserved. Page 3 SpaceClaim Developers Guide 1 Introduction 1.1 Purpose This document is intended to provide an overview of the SpaceClaim API and its fundamental concepts. This is the best place to start when learning about the API. Another useful resource is the “SpaceClaim_API.chm” help file, which contains the following sections: • Getting Started This explains how to write an add-in, which adds new commands to SpaceClaim. • Examples This provides download links to add-in command samples written in C#, F#, C++/CLI and Visual Basic .NET. These samples show how to use the API to perform specific tasks, such as traversing assembly structure, querying the topology and geometry of a body, or creating notes. • API Class Library This is the programming documentation for the classes, structs, methods, and properties in the API. 1.2 Programming Language Although the SpaceClaim API can be called from any .NET programming language (e.g. C#, F#, C++/CLI, Visual Basic .NET), all examples in this document are in C#. 1.3 Conventions Words in bold indicate types or members in the API. Copyright © 2008-2015, SpaceClaim Corp. All rights reserved. Page 4 SpaceClaim Developers Guide 2 Overview 2.1 Architecture The diagram shows a conceptual view of the SpaceClaim architecture as presented through the API. For the purposes of this diagram, each box represents a module, where each module makes use of other modules below it in the diagram. The box sizes have no significance. Copyright © 2008-2015, SpaceClaim Corp. All rights reserved. Page 5 Geometry Curve (Line, Circle, ...), Surface (Plane, Cylinder, ...), Matrix, Point, Direction, ... Modeler Body, Shell, Face, Edge, Loop, Fin, Vertex, Tracker, ... Graphics Graphic, CurveDisplay, ArrowDisplay, TextDisplay, ... DocObjects Part, Component, DesignBody, DesignCurve, DatumPlane, DrawingSheet, DrawingView, ... Windows Window, InteractionContext, SectionCurve, ... Commands Add-ins AddIn, ApiExtension, CommandCapsule, ... Interaction Tools Namespaces SpaceClaim.Api.V11 SpaceClaim.Api.V11.Graphics SpaceClaim.Api.V11.Modeler SpaceClaim.Api.V11.Geometry SpaceClaim.Api.V11.Extensibility SpaceClaim Developers Guide These modules are merely conceptual groupings, since the only separation apparent in the API is the separation in to namespaces, which are shown in different colors in the diagram. Listed within many of the modules in the diagram are examples of types published by that module. 2.2 Doc Objects Of particular importance is the distinction between doc objects, and the lower-level modeler and geometric objects. Doc objects, as the name suggests, belong to documents. They are first class objects, since they belong to a parent-child hierarchy, and they provide monikers (for persistent identifiers) and update states (for associative update). Many doc objects have references to modeler or geometry objects: • Design bodies, design faces, and design edges are doc objects that have a reference to a corresponding modeler object: a body, face, or edge. You can create a modeler body without creating a design body, but this means no document is modified and nothing appears in the window. This can be useful if you want to perform some modeling calculation. You may or may not create a design body at the end. • Design curves are doc objects that have a reference to a trimmed curve, which is a geometry object. Again, you can create curves and trimmed curves without ever creating a design curve, but design curves are what get displayed in windows. (You can create graphics display primitives, which reference geometry objects too, and these also get displayed in the window, although display primitives are not doc objects.) • Datum planes are doc objects that have a reference to a plane, which is a geometry object. Again, you can create planes and other surfaces without ever creating a datum plane. Typically the doc object will have more properties than the modeler or geometry object that it references, such as name, layer, visibility, or color. 2.3 Document Structure A document contains the following objects: Copyright © 2008-2015, SpaceClaim Corp. All rights reserved. Page 6 Document Parts Drawing Sheets Layers Document Materials Windows SpaceClaim Developers Guide Parts A document always contains at least one part, known as its main part, and this represents the design. If the main part has internal components (instances of other parts that belong to the same document), the document will contain other parts too. Internal components are also used for beam profiles, mid-surface parts, and sheet metal unfolded parts. The structure of a part is described below. Drawing Sheets A document contains zero or more drawing sheets. The structure of a drawing sheet is described below. Layers A document contains one or more layers. There is always a default layer, and if you delete another layer, all its objects are moved to the default layer. You cannot delete the default layer. The default layer is not the same as the active layer, which is the layer to which new objects are assigned. The active layer is a property of the window. Materials A document contains zero or more document materials, which are materials used by parts, design bodies, or beams in that document. Windows A document contains one or more windows, but it may not have any windows loaded. If the document is explicitly opened, then its windows are also loaded and opened, but if a document is loaded implicitly, for example because it is referenced from another open document, then its windows are not loaded. A window shows a scene, which is the root of the object hierarchy it displays. The window scene can be a part or a drawing sheet belonging to the same document. The window also provides access to interaction contexts, which allow you to work in a specific coordinate space. The interaction context presents the current selection in that coordinate space. A useful interaction context is the active context, which is the context in which the user is working. 2.4 Part Structure The SpaceClaim object model is quite flat, with the part being a bucket for many objects: Copyright © 2008-2015, SpaceClaim Corp. All rights reserved. Page 7 SpaceClaim Developers Guide Components A part contains zero or more components. A component is an instance of another template part. The template part may belong to the same document (an internal component), or it may belong to another document (an external component). Design Bodies A part contains zero or more design bodies. A design body can be open (a surface body) or closed (a solid body). A design body contains design faces and design edges. Design Curves A part contains zero or more design curves. Design curves have 3D geometry, even though they are often sketched in a plane. For example, if you copy and paste design edges, design curves are created, and these need not lie in a plane. Copyright © 2008-2015, SpaceClaim Corp. All rights reserved. Page 8 Part ... Components Design Bodies Design Curves Datum Planes Coordinate Systems Design Faces Design Edges Design Curves Notes Spot Weld Joints Components Images Beams ... Part Sheet Metal Bends Coordinate Axes SpaceClaim Developers Guide Design curves can also belong to datum planes and drawing sheets. Datum Planes A part contains zero or more datum planes. As well as serving as construction planes, as the name suggests, datum planes can also contain design curves and text notes, which lie in the plane,. When the datum plane is moved, its children are moved too. Coordinate Systems A part contains zero or more coordinate systems. A coordinate system contains three mutually perpendicular coordinate axes. The world coordinate system, which can be displayed in the user interface, does not belong to any document, and is not presented through the API. Sheet Metal Bends If a part is a sheet metal part, then it contains zero or more sheet metal bends, which might be cylindrical uploads/Ingenierie_Lourd/ developers-guide 5 .pdf

  • 12
  • 0
  • 0
Afficher les détails des licences
Licence et utilisation
Gratuit pour un usage personnel Attribution requise
Partager