Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Automate Marking Sheet Metal Bend Lines

5 REPLIES 5
SOLVED
Reply
Message 1 of 6
jwmb224
346 Views, 5 Replies

Automate Marking Sheet Metal Bend Lines

Hello,

   our plant has introduced marking bend lines on sheet metal parts for the operators on the press brakes to have an on-the-fly double-check mechanism that they are executing the correct program for the parts they are bending. it has been high successful in reducing all kinds of operator errors, both at the press brakes, and further down the line if the error wasn't detected at the press brakes.

   the issue at hand is, the bend line markers are extremely tedious for the CAD department to install and maintain. (maintain if the part needs changes and inventor can't solve the feature after the changes)

   here is what it looks like after markers are installed:

Bend Markers.png

    the above samples entails creating a flat pattern sketch, including all the bend lines as sketch geometry, adding a hole at each endpoint, constraining all the holes together to speed up entering hole size, cutting said hole, and creating a two corner rounds per each hole to minimize sharp corners for laser cutter/material handling. as you might imagine, this is extremely tedious.

   would it be possible to automate this process using iLogic? i have heard rumors from some of my friends that they've seen it done, but have so far not been able to track down a sample code. i tried submitting the idea to idea station a while back, but it hasn't gotten a lot of traction. i also tried using ChatGPT to write some code for this, but executing the code had 0 effect on the part, and ChatGPT's debug output was empty. i am not a coder, so i don't even know where i would start on this.

   is there anybody that has this running, or could contribute some code to do it? it doesn't sound very complicated. but again, what do i know? all i know is that me and my carpel tunnel would really really appreciate having this.

   in an ideal world, once the part is done, i could execute a certain iLogic rule and inventor would zip through making the markers. i am open to suggests on which feature would do it best between Hole, Cut, Extrude, Punch, etc. If the part changed and Inventor couldn't solve the feature afterwards, maybe it would be simple enough to just delete them all and execute the script again? i think almost anything would be a step up from fully manual.

 

jared

5 REPLIES 5
Message 2 of 6
JelteDeJong
in reply to: jwmb224

You could try something like this. ( you can change the size of the dimples and their radius in lines 1 and 2)

Dim dimpleRadius = 0.25 'Cm
Dim cornerRoundRadius = 0.1 'Cm

Dim doc As PartDocument = ThisDoc.Document
Dim def As SheetMetalComponentDefinition = doc.ComponentDefinition

If def.HasFlatPattern = False Then
	def.Unfold()
End If

Dim flatPattern = def.FlatPattern
flatPattern.Edit()

Dim newSketch = flatPattern.Sketches.Add(flatPattern.TopFace)

For Each result As FlatBendResult In flatPattern.FlatBendResults
	If result.IsOnBottomFace Then Continue For

	Dim line As SketchLine = newSketch.AddByProjectingEntity(result.Edge)
	line.Construction = True

	Dim c1 = newSketch.SketchCircles.AddByCenterRadius(line.StartSketchPoint, dimpleRadius)
	Dim c2 = newSketch.SketchCircles.AddByCenterRadius(line.EndSketchPoint, dimpleRadius)

	newSketch.DimensionConstraints.AddDiameter(c1, line.StartSketchPoint.Geometry)
	newSketch.DimensionConstraints.AddDiameter(c2, line.EndSketchPoint.Geometry)
Next

Dim profile = newSketch.Profiles.AddForSolid()

Dim cutDef = flatPattern.Features.CutFeatures.CreateCutDefinition(profile)
Dim cutFeature = flatPattern.Features.CutFeatures.Add(cutDef)

Dim cornerRoundFeatures = flatPattern.Features.CornerRoundFeatures

For Each face As Face In cutFeature.Faces

	For Each edge As Edge In face.Edges
		For Each face2 As Face In edge.Faces
			If (face2 Is face) Then Continue For
			If (face2 Is flatPattern.BottomFace) Then Continue For

			Try
				Dim edgeCollection = ThisApplication.TransientObjects.CreateEdgeCollection()
				edgeCollection.Add(edge)
				Dim roundDef = cornerRoundFeatures.CreateCornerRoundDefinition(edgeCollection, cornerRoundRadius)
				Dim tempFeature = cornerRoundFeatures.Add(roundDef)
			Catch ex As Exception

			End Try
		Next
	Next
Next

 There are some situations, that I can think of, where you get unexpected results. For example in this situation if the dimple radius is too big. Then it will also cut the other edge!

JelteDeJong_0-1709481681887.png

Another scenario that could go wrong is when you have cut across bends. In those cases, I have seen that Inventor can give strange results.

Therefore you should check the result of this iLogic rule always manually before you use it in production!

 

Jelte de Jong
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature


Blog: hjalte.nl - github.com

Message 3 of 6
jwmb224
in reply to: jwmb224

ha! you did it. works flawlessly on the parts i tested it with. thank you from the united states.

 

jared

Message 4 of 6
harvey3ELEA
in reply to: jwmb224

Nice routine JelteDeJong.  I was doing those dimples manually, and while not difficult, they were certainly tedious as mentioned above.  Thanks from Florida!

Message 5 of 6
jwmb224
in reply to: jwmb224

if anybody encounters this idea and likes it, here is an idea station suggestion i put together of this a while ago, but it hasn't seemed to take off. go vote it up!

Message 6 of 6
harvey3ELEA
in reply to: jwmb224

Unfortunately, a lot of great ideas go to die over in the Idea Station, but this one's a keeper.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report