Center Marking in Detail View

Center Marking in Detail View

ss13953642009
Advocate Advocate
133 Views
1 Reply
Message 1 of 2

Center Marking in Detail View

ss13953642009
Advocate
Advocate

am8_20241219140557136.png

How to use the Inventor 2021 API to add a center mark to a selected curve in a detail view, or to automatically add a centerline mark to the detail view using code.

0 Likes
134 Views
1 Reply
Reply (1)
Message 2 of 2

tim11_manhhieu
Advocate
Advocate
Option Explicit

Sub AutomatedCenterline()

On Error Resume Next

Dim doc As DrawingDocument
Set doc = ThisApplication.ActiveDocument

Dim oSheet As sheet
Set oSheet = doc.ActiveSheet

Dim oview As DrawingView

For Each oview In oSheet.DrawingViews

    Dim oSettings As AutomatedCenterlineSettings
    'Get the settings
    Call oview.GetAutomatedCenterlineSettings(oSettings)
    'Set the settings
    oSettings.ApplyToBends = False
    oSettings.ApplyToCircularPatterns = False
    oSettings.ApplyToCylinders = True
    oSettings.ApplyToFillets = False
    oSettings.ApplyToHoles = True
    oSettings.ApplyToPunches = True
    oSettings.ApplyToRectangularPatterns = False
    oSettings.ApplyToRevolutions = True
    oSettings.ApplyToSketches = False
    oSettings.ApplyToWorkFeatures = False
    oSettings.ProjectionNormalAxis = True
    oSettings.ProjectionParallelAxis = True
    'Apply the settings
    Call oview.SetAutomatedCenterlineSettings(oSettings)
    
Next

End Sub
0 Likes