VB.net vs iLogic for Automated Centerlines giving different results - VB.net Automated Centerlines have 'crosshairs' instead line pointing towards center of circular pattern
I'm running into a strange issue where setting the Automated Centerlines in a VB.NET Inventor addin doesn't give the expected results. I tried digging around on these forums, but failed to find anybody else that mentioned this issue.
This is a snippet of the iLogic, and it does exactly what I want it to do.
Dim oBaseView As DrawingView
oBaseView = ThisApplication.ActiveDocument.Sheets(1).DrawingViews(1)
Dim oACS As AutomatedCenterlineSettings
oBaseView.GetAutomatedCenterlineSettings(oACS)
oACS.ApplytoHoles = True
oACS.ApplyToCircularPatterns = True
oBaseView.SetAutomatedCenterlineSettings(oACS)
The result of the iLogic:
Here is the code in VB.net.
'Does the automated centerlines command
g_inventorApplication.StatusBarText = "Adding additional centerlines..."
Dim centerlineSettings As AutomatedCenterlineSettings = FlangePlateDrawing.DrawingSettings.AutomatedCenterlineSettings
FlangePlateDrawingSheet.DrawingViews.Item(1).GetAutomatedCenterlineSettings(centerlineSettings) 'Get
centerlineSettings.ApplyToBends = False
centerlineSettings.ApplyToCylinders = False
centerlineSettings.ApplyToFillets = False
centerlineSettings.ApplyToPunches = False
centerlineSettings.ApplyToRectangularPatterns = False
centerlineSettings.ApplyToRevolutions = False
centerlineSettings.ApplyToSketches = False
centerlineSettings.ApplyToWorkFeatures = False
centerlineSettings.ApplyToCircularPatterns = True
centerlineSettings.ApplyToHoles = True
centerlineSettings.ProjectionNormalAxis = True
centerlineSettings.ProjectionParallelAxis = False
centerlineSettings.RadiusThresholdPrecision = 2
FlangePlateDrawingSheet.DrawingViews.Item(1).SetAutomatedCenterlineSettings(centerlineSettings) 'Set
and here is the result of that code:
I've tried several times, such as commenting out all of the centerlineSettings lines that are being set to false, adding a delay before the FlangePlateDrawingSheet.DrawingViews.Item(1).SetAutomatedCenterlineSettings(centerlineSettings) line, and not including the ProjectionNormalAxis or RadiusThresholdPrecision values to make the code only have the same properties being set as the iLogic. One interesting thing I discovered in my debugging attempts is that if it doesn't set ApplyToCircularPatterns equal to True, I get the crosshairs centerlines for all of the holes. This lead me to think maybe it's processing too fast and putting the crosshairs centerlines in before it realizes that all of the holes are in the circular pattern. I thought adding a delay might fix that, but it did not.
I'm using Visual Studio 2019 to develop an addin for Inventor 2019 (originally for Inventor 2016).
Does anybody know why this is happening and how to fix it?