Center mark lose reference when 3d features is suppressed

Center mark lose reference when 3d features is suppressed

joaopirotta
Enthusiast Enthusiast
410 Views
1 Reply
Message 1 of 2

Center mark lose reference when 3d features is suppressed

joaopirotta
Enthusiast
Enthusiast

Hi everyone,

I'm using Inventor 2020 and I would like to know how to control center mark when 3d features is suppressed. In the example below I have a flange that was configuration in iLogic to control number of holes.

If the number of holes was change from 6 holes to 5 holes, the center marks lose reference. Is there a way to control this?

If my flange has 6 holes I must have to just 6 center marks
If my flange has 5 holes I must have to just 5 center marks
...

 

center marks lost.gif

0 Likes
Accepted solutions (1)
411 Views
1 Reply
Reply (1)
Message 2 of 2

WCrihfield
Mentor
Mentor
Accepted solution

This is a fairly common issue.  There are multiple ways to deal with it, but here is one of the simpler ways.  Use an iLogic rule that will delete all the existing Centermarks on the sheet (or just a specified view), then recreate them using the 'Automated Centerlines' tool (simulated by the code).  My example loops through every view on the 'active' sheet, deleting all the centermarks, then recreates them using that automated tool.  I added a reference Sub in there, just to make sure that automated tool is set-up the way you want it (in case you don't regularly use it and don't already have it set-up the way you like).  Then either run the rule manually, or set it up to run when some event happens (such as the one called "Dawing View Change" within the Event Triggers dialog - [when model changes cause view to update]).

Here's the 'local' iLogic rule code:

Sub Main
	Dim oDDoc As DrawingDocument = ThisDoc.Document
	Dim oSheet As Sheet = oDDoc.ActiveSheet
	'delete all existing Centermarks
	For Each oCM As Centermark In oSheet.Centermarks
		oCM.Delete
	Next

	'create new Centermarks
	UpdateCLSettings(oDDoc) 'uses below Sub to update centerline/centermark settings
	Dim oCLs As ObjectsEnumerator
	For Each oView As DrawingView In oSheet.DrawingViews
		oCLs = oView.SetAutomatedCenterlineSettings(oACS)
	Next
End Sub

Sub UpdateCLSettings(oDrawDoc As DrawingDocument)
	'make sure your Automated Centerline (and Centermark) Settings are the way you want them
	Dim oACS As AutomatedCenterlineSettings = oDrawDoc.DrawingSettings.AutomatedCenterlineSettings
	oACS.ApplyToBends = False
	oACS.ApplyToCircularPatterns = True
	oACS.ApplyToCylinders = False
	oACS.ApplyToFillets = False
	oACS.ApplyToHoles = True
	oACS.ApplyToPunches = True
	oACS.ApplyToRectangularPatterns = True
	oACS.ApplyToRevolutions = False
	oACS.ApplyToSketches = False
	oACS.ApplyToWorkFeatures = False
	'oACS.ArcAngleThreshold = 
	'oACS.CircularEdgeMaximumThreshold = 
	'oACS.CircularEdgeMinimumThreshold = 
	'oACS.FilletRadiusMaximumThreshold = 
	'oACS.FilletRadiusMinimumThreshold = 
	oACS.ProjectionNormalAxis = True
	oACS.ProjectionParallelAxis = True
	'oACS.RadiusThresholdPrecision = 
End Sub

If this solved your problem, or answered your question, please click ACCEPT SOLUTION.
Or, if this helped you, please click (LIKE or KUDOS) 👍.

If you want and have time, I would appreciate your Vote(s) for My IDEAS 💡or you can Explore My CONTRIBUTIONS

Wesley Crihfield

EESignature

(Not an Autodesk Employee)