iLogic code to adjust multiple break gaps

iLogic code to adjust multiple break gaps

Scott.Hallmark
Advocate Advocate
1,337 Views
4 Replies
Message 1 of 5

iLogic code to adjust multiple break gaps

Scott.Hallmark
Advocate
Advocate

I have a nagging issue of break gaps being set by drawing view scale.  I want to be able to set a value and then select each gap to adjust or have the code select them all and adjust all at once.  I can do this individually but we have long extruded metal with multiple holes and notches in them that will not fit on a sheet without multiple gaps. Changing them all is a pain.  And before you say it, I know if you set it the first time, it keeps it from then on in the drawing but I have other people detailing also and they do not necessarily follow the guidelines and I am going back and fixing them, one at a time.  Need a quick fix.

 

 

ilogic-breakdialog.png

 

** If my reply resolves this issue, please choose Accept Solution **
Scott Hallmark, Design Specialist | Fluor Corporation
Inventor and AutoCAD Certified Professional, Autodesk Certified Instructor | My Plant3D Notes | AU Speaker | ROLL TIDE!
Accepted solutions (1)
1,338 Views
4 Replies
Replies (4)
Message 2 of 5

Anonymous
Not applicable
Accepted solution

Hey Scott,

 

If I understand correctly what you are looking to do, I think I might have a solution. If you basically want all gaps in a break view to be a certain value, the iLogic code below should do that. It is currently set to look at View 1 but you can probably rewrite to do all views. But hopefully this will point you in the right direction.

 

DanV

 

Dim oView As DrawingView = ActiveSheet.View("VIEW1").View

For Each oBreakOp As BreakOperation In oView.BreakOperations
	oBreakOp.Gap = 0.1 * 2.54
Next

 

Message 3 of 5

JamieVJohnson2
Collaborator
Collaborator

So here is the logic tree to follow:
Inventor.Application (ThisApplication)

.ActiveDocument (better be a drawing document)

.ActiveSheet (better be on the sheet your interested in, or you can cycle through all sheets with .Sheets.Item)

.DrawingViews.Item (one way to jump down to here is to preselect the view, and use selection set)

.BreakOperations (probably best to cycle through all of these)

.Gap (here is the value you want to change, Inventor thinks in centimeters, so you may need to do the math before setting the value)

 

Jamie Johnson : Owner / Sisu Lissom, LLC https://sisulissom.com/
Message 4 of 5

Scott.Hallmark
Advocate
Advocate

Slick as mud!  That worked great.  I just need to get it to let me pick the view I want to push that rule to.  I can get that pretty easily.  Thanks Dan!

** If my reply resolves this issue, please choose Accept Solution **
Scott Hallmark, Design Specialist | Fluor Corporation
Inventor and AutoCAD Certified Professional, Autodesk Certified Instructor | My Plant3D Notes | AU Speaker | ROLL TIDE!
0 Likes
Message 5 of 5

Scott.Hallmark
Advocate
Advocate

Here's my final code...

 

Dim doc As DrawingDocument = ThisDoc.Document
Dim oSheet As Sheet = doc.ActiveSheet

GapValue = InputBox("Enter Gap Value: ", "Global Gap value for Breaks", "0.0625")

For Each oDrawView In oSheet.DrawingViews
For Each oBreakOp As BreakOperation In oDrawView.BreakOperations
oBreakOp.Gap = GapValue * 2.54
Next
Next

** If my reply resolves this issue, please choose Accept Solution **
Scott Hallmark, Design Specialist | Fluor Corporation
Inventor and AutoCAD Certified Professional, Autodesk Certified Instructor | My Plant3D Notes | AU Speaker | ROLL TIDE!