x-post... iLogic rule to create automated centerline​s

x-post... iLogic rule to create automated centerline​s

Anonymous
Not applicable
1,211 Views
1 Reply
Message 1 of 2

x-post... iLogic rule to create automated centerline​s

Anonymous
Not applicable

Forgive the cross-posting, but I've been told this might be the better forum to ask on...

 

So here's the problem I've got; iLogic part/assembly has a variable flange drilling.  As size increases/decreases (or user changes certain parameters in the assembly), the number of holes in my flange changes. 

 

It's not good enough to pre-create the drawing with automated centerlines.  If the number of holes changes, 'automated centerlines' doesn't update the drawing, and the circular pattern on the flange loses it's reference.

 

What I'd love to do is create a rule that upon opening the drawing, iLogic runs a rule that places automated centerlines on the appropriate views.  However, this isn't an option in the iLogic dialog.  The only solution I can come up with is creating a macro that iLogic can run.  I'm working on my programming skills, but I have no idea where to even start with programming that.

 

Playing with the VBA Editor, I can find the 'AutomatedCenterlineSettings' objects... but I have no clue how to put that into programming language. 

 

Anyone able to help with this? 

 

I'm loving the power of iLogic!

0 Likes
1,212 Views
1 Reply
Reply (1)
Message 2 of 2

MjDeck
Autodesk
Autodesk

In Inventor 2011, you can do this with some API functions in a rule.  Here's a sample:

 

ActiveSheet.View("VIEW1").View.SetAutomatedCenterlineSettings()
' Delete all un-attached centerlines
For Each centerLine In ActiveSheet.Sheet.CenterLines
 If (Not centerLine.Attached) Then
   centerLine.Delete()
 End If
Next

ActiveSheet.View("VIEW1").View.SetAutomatedCenterlineSettings()

 

' Delete all unattached centerlines

For Each centerLine In ActiveSheet.Sheet.CenterLines 

  If (Not centerLine.Attached) Then  

    centerLine.Delete() 

  End If

Next

 

The SetAutomatedCenterlineSettings function will create missing centerlines. 

The code to delete the unattached centerlines is required if you reduce the number of holes in a pattern.  The missing holes will leave unattached centerlines.  There are probably other operations that would leave them. 

 

You can set this rule to run whenever there are changes in the model.   On the Manage tab, under iLogic, use the Event Triggers command.  Double-click on the Drawing View Change event, and choose this rule to run on that event.


Mike Deck
Software Developer
Autodesk, Inc.

0 Likes