Details
How to offset command in sketch (Line object) in drafting?
Solution
By considering user have existing Line sketch in drafting file run below sample code to offset Line object,
Imports System.IO
Imports System.Runtime.InteropServices
Imports SolidEdgeAssembly
Imports SolidEdgeFramework
Imports SolidEdgeConstants
ModuleModule1
Sub Main()
Dim objApplication As SolidEdgeFramework.Application
Dim Line As SolidEdgeFrameworkSupport.Line2d
Dim DraftDoc As SolidEdgeDraft.DraftDocument
Dim SelectSet As SolidEdgeFramework.SelectSet
Dim Sheet As SolidEdgeDraft.Sheet = Nothing
Dim x AsDouble
Dim y AsDouble
Try
' Create/get the application with specific settings
objApplication = Marshal.GetActiveObject("SolidEdge.Application")
' open the document mentioned in the doc files.
DraftDoc = objApplication.ActiveDocument
Sheet = DraftDoc.Sheets.Item(1)
Line = Sheet.Lines2d.Item(1)
Line.GetEndPoint(x, y)
Sheet.ChainLocate(x, y)
SelectSet = DraftDoc.SelectSet
Sheet.Offset2d(x + 0.005, y + 0.005, 0.005)
Catch ex AsException
MsgBox(ex.ToString)
EndTry
EndSub
EndModule
Hardware/Software Configuration
Platform: INTL64
OS: window
OS Version: 764
Product: SOLID_EDGE
Application: AUTOMATION
Version: V109MP7
Function: API_DOCUMENT
Ref: 002-8013897