Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
chandra.shekar.g
in reply to: GeorgK

@GeorgK,

 

At below code, extension of lines can be added depends on line type (Like Horizontal or Vertical).

Dim oStartPt As Point2d
        Set oStartPt = ThisApplication.TransientGeometry.CreatePoint2d(oSheet.Centerlines.Item(i).StartPoint.X, oSheet.Centerlines.Item(i).StartPoint.Y)
        
        Dim oStart As Point2d
        Set oStart = oView.SheetToDrawingViewSpace(oStartPt)
        
        Dim oEndPt As Point2d
        Set oEndPt = ThisApplication.TransientGeometry.CreatePoint2d(oSheet.Centerlines.Item(i).EndPoint.X, oSheet.Centerlines.Item(i).EndPoint.Y)
        
        Dim oEnd As Point2d
        Set oEnd = oView.SheetToDrawingViewSpace(oEndPt)
        
        Dim oLine As SketchLine
        Set oLine = oSketch.SketchLines.AddByTwoPoints(oStart, oEnd)

Thanks and regards,


CHANDRA SHEKAR G
Developer Advocate
Autodesk Developer Network