Transcription of Solid Edge – Siemens PLM Software
1 Solid Edge Siemens PLM Software .NET programmer s guide Solid Edge with Synchronous Technology API 2 Introduction Table of Contents CHAPTER 1 - INTRODUCTION ---------------------------------------- --------------------------------- 8 Who Should Read This Book ---------------------------------------- ---------------------------------------- -------------------------------- 8 Visual Basic Users ---------------------------------------- ---------------------------------------- ---------------------------------------- - 8 Software Requirements ---------------------------------------- ---------------------------------------- -------------------------------------- 9 CHAPTER 2 - API OVERVIEW ---------------------------------------- -------------------------------- 10 Solid Edge Core Type Libraries ---------------------------------------- ---------------------------------------- ------------------------------ 11 Table of core APIs ---------------------------------------- ---------------------------------------- ---------------------------------------- ---- 11 SolidEdgeFramework Type Library ( ) ---------------------------------------- ---------------------------------------- - 12 SolidEdgeFrameworkSupport Type Library ( ) ---------------------------------------- -------------------------------- 12 SolidEdgePart Type Library ( ) ---------------------------------------- ---------------------------------------- ------------------- 12 SolidEdgeGeometry Type Library ( ) ---------------------------------------- ---------------------------------------- --- 12 SolidEdgeAssembly Type Library ( ) ---------------------------------------- ---------------------------------------- ----- 12 SolidEdgeDraft Type Library ( ) ---------------------------------------- ---------------------------------------- ---------------- 12 SolidEdgeConstants Type Library ( )
2 ---------------------------------------- ---------------------------------------- ----- 12 Solid Edge Utility APIs ---------------------------------------- ---------------------------------------- ---------------------------------------- - 13 Table of utility APIs ---------------------------------------- ---------------------------------------- ---------------------------------------- -- 13 SEInstallDataLib ( ) ---------------------------------------- ---------------------------------------- ---------------------- 14 SolidEdgeFileProperties ( ) ---------------------------------------- ---------------------------------------- ---------------- 14 RevisionManager ( ) ---------------------------------------- ---------------------------------------- --------------------------- 14 CHAPTER 3 - .NET OVERVIEW ---------------------------------------- ------------------------------ 15 Terminology ---------------------------------------- ---------------------------------------- ---------------------------------------- -------------- 16 Application Domain ---------------------------------------- ---------------------------------------- ---------------------------------------- - 16 Assembly ---------------------------------------- ---------------------------------------- ---------------------------------------- --------------- 16 COM Interop ---------------------------------------- ---------------------------------------- ---------------------------------------- ---------- 16 Garbage Collection ---------------------------------------- ---------------------------------------- ---------------------------------------- -- 16 Interop Assemblies ---------------------------------------- ---------------------------------------- ---------------------------------------- -- 16
3 Marshal Class ---------------------------------------- ---------------------------------------- ---------------------------------------- --------- 16 Runtime Callable Wrapper (RCW) ---------------------------------------- ---------------------------------------- ----------------------- 17 CHAPTER 4 - GETTING STARTED ---------------------------------------- -------------------------- 18 Your first macro ---------------------------------------- ---------------------------------------- ---------------------------------------- --------- 19 Create a new Visual Basic .NET project ---------------------------------------- ---------------------------------------- ---------------- 19 Adding a reference to Solid Edge API------------------------------------- ---------------------------------------- ---------------------- 19 Viewing Interop Assembly References ---------------------------------------- ---------------------------------------- ----------------- 21 Connecting to Solid Edge (Visual ) ---------------------------------------- ---------------------------------------- --------- 24 Connecting to Solid Edge (C#) ---------------------------------------- ---------------------------------------- ---------------------------- 24 3 Introduction Starting Solid Edge (Visual Basic.)
4 NET) ---------------------------------------- ---------------------------------------- ----------------- 25 Starting Solid Edge (C#) ---------------------------------------- ---------------------------------------- ------------------------------------ 25 Working with Documents ---------------------------------------- ---------------------------------------- ------------------------------------ 27 Table of document ProgIds ---------------------------------------- ---------------------------------------- ------------------------------- 27 Creating Documents Example (Visual ) ---------------------------------------- ---------------------------------------- --- 27 Creating Documents Example (C#) ---------------------------------------- ---------------------------------------- ---------------------- 28 Determining Document Type Example (Visual ) ---------------------------------------- -------------------------------- 30 Determining Document Type Example (C#) ---------------------------------------- ---------------------------------------- ---------- 32 CHAPTER 5 - UNITS OF MEASURE--------------------------------- --------------------------------- 34 Internal Units ---------------------------------------- ---------------------------------------- ---------------------------------------- --------- 35 Working with Units of Measure ---------------------------------------- ---------------------------------------- ---------------------------- 36 Formatting and Displaying Units (Visual ) ---------------------------------------- ---------------------------------------- 36 Formatting and Displaying Units (C#)
5 ---------------------------------------- ---------------------------------------- ------------------ 37 CHAPTER 6 - PART AND SHEET METAL DOCUMENTS ---------------------------------------- 40 Models Collection ---------------------------------------- ---------------------------------------- ---------------------------------------- --- 40 Model Object ---------------------------------------- ---------------------------------------- ---------------------------------------- --------- 40 Reference Planes---------------------------------- ---------------------------------------- ---------------------------------------- ----------- 40 Profiles ---------------------------------------- ---------------------------------------- ---------------------------------------- ------------------ 40 Modeling Coordinate System ---------------------------------------- ---------------------------------------- ----------------------------- 41 2D Geometry ---------------------------------------- ---------------------------------------- ---------------------------------------- ---------- 41 2D Relationships ---------------------------------------- ---------------------------------------- ---------------------------------------- ----- 41 Variables ---------------------------------------- ---------------------------------------- ---------------------------------------- --------------- 42 Part Modeling Examples ---------------------------------------- ---------------------------------------- -------------------------------------- 44 Modeling a Part (Visual Basic.)
6 NET) ---------------------------------------- ---------------------------------------- --------------------- 44 Modeling a Part (C#) ---------------------------------------- ---------------------------------------- ---------------------------------------- 47 Variables Examples ---------------------------------------- ---------------------------------------- ---------------------------------------- ----- 53 Variable Table Example(Visual Basic .NET)----------------------------------- ---------------------------------------- ----------------- 53 Variable Table Example(C#) ---------------------------------------- ---------------------------------------- ------------------------------- 54 Working with Dimensions Overview ---------------------------------------- ---------------------------------------- -------------------- 56 Linear Dimensions ---------------------------------------- ---------------------------------------- ---------------------------------------- --- 56 Radial Dimensions ---------------------------------------- ---------------------------------------- ---------------------------------------- --- 56 Angular Dimensions ---------------------------------------- ---------------------------------------- ---------------------------------------- - 56 Placing Dimensions ---------------------------------------- ---------------------------------------- ---------------------------------------- ----- 57 Placing Dimensions Example (Visual Basic.
7 NET) ---------------------------------------- ---------------------------------------- ---- 57 Placing Dimensions Example (C#) ---------------------------------------- ---------------------------------------- ----------------------- 60 Dimensions via Variables ---------------------------------------- ---------------------------------------- ------------------------------------- 64 Accessing Dimensions through the Variable Table (Visual Basic .NET) ---------------------------------------- ---------------- 64 4 Introduction Accessing Dimensions through the Variable Table (C#) ---------------------------------------- ----------------------------------- 67 CHAPTER 7 - ASSEMBLIES DOCUMENTS ---------------------------------------- ----------------- 72 Reference Axes ---------------------------------------- ---------------------------------------- ---------------------------------------- ---------- 72 Creating Reference Elements (Visual Basic .NET) ---------------------------------------- ---------------------------------------- --- 72 Creating Reference Elements (C#) ---------------------------------------- ---------------------------------------- ---------------------- 74 Occurrences ---------------------------------------- ---------------------------------------- ---------------------------------------- -------------- 76 Adding a new Occurrence (Visual Basic.
8 NET) ---------------------------------------- ---------------------------------------- -------- 77 Adding a new Occurrence (C#) ---------------------------------------- ---------------------------------------- --------------------------- 78 Manipulating Occurrences (Visual Basic .NET) ---------------------------------------- ---------------------------------------- ------- 80 Manipulating Occurrences (C#) ---------------------------------------- ---------------------------------------- -------------------------- 82 References ---------------------------------------- ---------------------------------------- ---------------------------------------- ---------------- 86 Analyzing Existing Assembly Relationships ---------------------------------------- ---------------------------------------- ----------- 86 Analyzing Existing Assembly Relationships (Visual Basic .NET) ---------------------------------------- -------------------------- 87 Analyzing Existing Assembly Relationships (C#) ---------------------------------------- ---------------------------------------- ----- 88 Adding New Assembly Relationships ---------------------------------------- ---------------------------------------- ------------------- 90 Adding New Assembly Relationships (Visual Basic.
9 NET) ---------------------------------------- --------------------------------- 92 Adding New Assembly Relationships (C#) ---------------------------------------- ---------------------------------------- ------------- 96 CHAPTER 8 - DRAFT DOCUMENTS ---------------------------------------- ------------------------102 Sections and Sheets ---------------------------------------- ---------------------------------------- ---------------------------------------- -- 102 Sections and Sheets Example (Visual Basic .NET) ---------------------------------------- ---------------------------------------- - 102 Sections and Sheets Example (C#) ---------------------------------------- ---------------------------------------- -------------------- 104 SmartFrames ---------------------------------------- ---------------------------------------- ---------------------------------------- ----------- 107 Linking and Embedding Example (Visual Basic .NET) ---------------------------------------- ------------------------------------- 107 Linking and Embedding Example (C#) ---------------------------------------- ---------------------------------------- ---------------- 109 Symbols ---------------------------------------- ---------------------------------------- ---------------------------------------- ------------------ 111 Symbols Example (Visual Basic.
10 NET) ---------------------------------------- ---------------------------------------- ----------------- 111 Symbols Example (C#) ---------------------------------------- ---------------------------------------- ------------------------------------ 114 DrawingViews ---------------------------------------- ---------------------------------------- ---------------------------------------- ---------- 117 DrawingViews Example (Visual Basic .NET) ---------------------------------------- ---------------------------------------- --------- 117 DrawingViews Example (C#) ---------------------------------------- ---------------------------------------- ---------------------------- 119 CHAPTER 9 - HANDLING EVENTS ---------------------------------------- -------------------------122 Application Events ---------------------------------------- ---------------------------------------- ---------------------------------------- ---- 123 Table of Application Events ---------------------------------------- ---------------------------------------- ----------------------------- 123 Sinking Application Events (Visual ).