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

I just created the same model and it's working fine for me.  I'm using Inventor 2017.  I converted your code to VBA because it's a little easier to prototype and debug but they're both calling the same API so I wouldn't expect that to make any difference.  Here's my code that you can test on your drawing.  I narrowed it down to the two settings you can see below to get the desired result, but having the other setting didn't cause any problems either.

 

Public Sub CenterLineTest()
    Dim drawDoc As DrawingDocument
    Set drawDoc = ThisApplication.ActiveDocument
    
    Dim topView As DrawingView
    Dim sectionView As DrawingView
    Set topView = drawDoc.ActiveSheet.DrawingViews.Item(1)
    Set sectionView = drawDoc.ActiveSheet.DrawingViews.Item(2)
    
    Dim settings As AutomatedCenterlineSettings
    Set settings = drawDoc.DrawingSettings.AutomatedCenterlineSettings
    
    settings.ApplyToCylinders = True
    settings.ProjectionParallelAxis = True
    Call topView.SetAutomatedCenterlineSettings(settings)
    Call sectionView.SetAutomatedCenterlineSettings(settings)
End Sub

Brian Ekins
Inventor and Fusion 360 API Expert
Mod the Machine blog