- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I'm using the following code to apply automated Centerlines to what is basically a simple drawing of a washer. The washer is created by extruding the area between two circles, so there is not a hole feature. On the drawings, the topview is looking at the flat sides of the washer (OD, and ID) and the section is looking at a midplane cut (Thickness).
protected void applyAutomatedCenterlines()
{
AutomatedCenterlineSettings settings = DrawingDocument.DrawingSettings.AutomatedCenterlineSettings;
settings.ApplyToCircularPatterns = true;
settings.ApplyToCylinders = true;
settings.ApplyToHoles = true;
settings.ProjectionNormalAxis = true;
settings.ProjectionParallelAxis = true;
_topView.SetAutomatedCenterlineSettings(settings);
_sectionView.SetAutomatedCenterlineSettings(settings);
}
The result is that the centermark on the top of the washer is created, but the centerline on the section view is not.
If I select the section view afterwards and apply automated centerlines the settings I used above persit, and when applied, achieve the desired result.
I have confirmed that the _sectionView object is populated correctly.
Any thoughts why the automated version of this is not working using the same settings?
Here is a picture of the items I'm working with (desired center lines shown)
Thanks for any help!
Best of Luck
---------------------------------------------------------------------------------------------------------------------------------
If you find this reply helpful or insightful, please use the 'Accept as Solution' or 'Kudos' button below.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Brian,
Thanks for your reply.
The part is coming from content center (we're adding them dynamically to the content center tables, and then building assemblies and models and drawings of them automatically.)
I ran into an issue trying to get the assembly section view to behave (section participation and content center parts don't get along with the API), but I didn't have any such issue creating the section on the individual content center part. I can't help but think it is somehow related.
Thanks again for your thoughts.
Best of Luck
---------------------------------------------------------------------------------------------------------------------------------
If you find this reply helpful or insightful, please use the 'Accept as Solution' or 'Kudos' button below.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I just created a small assembly that included a content center washer, created a drawing and ran my little test script and it still worked as expected. Not sure what's going on in your case.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I performed a similar test, running an iLogic rule (based on your VBA) and the center line shows up correctly... Obviously there is something amiss, but it escapes me.
Thanks for your time!
Best of Luck
---------------------------------------------------------------------------------------------------------------------------------
If you find this reply helpful or insightful, please use the 'Accept as Solution' or 'Kudos' button below.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello!
Did you solve your problem? I have the same situation.
When I call the native command from the context menu I see my presettings, and I need only press OK button for proper result. But I cant do this in auto mode..
oDrawView.SetAutomatedCenterlineSettings(oACenterLines); - It looks like if that command line dont work..
