05-24-2017
11:45 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
05-24-2017
11:45 AM
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
