iLogic to create notches in flat pattern bends

iLogic to create notches in flat pattern bends

Anonymous
Not applicable
3,304 Views
12 Replies
Message 1 of 13

iLogic to create notches in flat pattern bends

Anonymous
Not applicable

I need help creating an iLogic rule as I am no coder by any means. Our company uses small notches at the bend lines of our flat patterns, but sketching these in again and again are rather tedious. The ends reach out to the bend radius and 1/16" inward along the center of the bend.

 

I found a rule that is similar to what I need, but not quite. Any suggestions?

https://forums.autodesk.com/t5/inventor-forum/automated-hole-creation-on-bend-lines/td-p/7119988

 

Notch.JPG

 

0 Likes
3,305 Views
12 Replies
Replies (12)
Message 2 of 13

chandra.shekar.g
Autodesk Support
Autodesk Support

@Anonymous,

 

Can you please provide sheet metal part after creating notches to test? Please make sure that files are non confidential.

 

Thanks and regards,


CHANDRA SHEKAR G
Developer Advocate
Autodesk Developer Network



0 Likes
Message 3 of 13

Anonymous
Not applicable

@chandra.shekar.g

 

Yes, I can provide the sheet metal part. The cut exists in the flat pattern. Thank you for your help!

0 Likes
Message 4 of 13

philip1009
Advisor
Advisor

Out of sheer curiosity could you provide the reason this notch is needed?  Maybe there's another solution that could be used that Inventor already has instead of using iLogic.

0 Likes
Message 5 of 13

Anonymous
Not applicable

@philip1009

 

Most often we create .dxf files from our flat patterns. We'll get the parts laser cut then folded. Problem is, some of our designs have been difficult to fold, so we have created notches at our bend lines to assist during the folding process which has benefited us well. As far as I know, Inventor doesn't provide this utility. 

0 Likes
Message 6 of 13

GeorgK
Advisor
Advisor
'[ edit these variables as needed
	
	sSketchName = "Flat Pattern Sketch"
	sHoleName = "Locator triangle"
	oOffset = 0.100 in'defines offset from edge of flat pattern
	
']	

    '  a reference to the active document.
    Dim oPartDoc As PartDocument
    oPartDoc = ThisApplication.ActiveDocument
	
	'verify document type is sheet metal
	If oPartDoc.ComponentDefinition.Type <> 150995200 Then
		MessageBox.Show("File is not a sheet metal part.", "iLogic")
		Exit Sub
	End If
	
	Dim oCompDef As SheetMetalComponentDefinition
	oCompDef = oPartDoc.ComponentDefinition

    ' Check to make sure a flat pattern is open.
    If Not TypeOf ThisApplication.ActiveEditObject Is FlatPattern Then
		Try
			If oCompDef.HasFlatPattern = False Then
				oCompDef.Unfold
			Else
				oCompDef.FlatPattern.Edit
			End If
		Catch
			MessageBox.Show("Error editting the flat pattern.", "iLogic")

		End Try
    End If



    '  a reference to the active flat pattern.
    Dim oFlatPattern As FlatPattern
    oFlatPattern = ThisApplication.ActiveEditObject

	'clean up existing cutouts
	Dim oCutFeatures 
	For Each oCutFeatures In oFlatPattern.Features.CutFeatures
		oCutFeatures.Delete
		MsgBox("Done")
	Next
	 
	Dim oFace As Face
	oFace = oFlatPattern.TopFace

    Dim oSketch As PlanarSketch
	
	'clean up existing sketch
	For Each oSketch In oFlatPattern.Sketches
		If oSketch.Name = sSketchName Then
			oSketch.Delete
		End If
	Next
	
	' Create a new sketch.  The second argument specifies to include/not include
    ' the edges of the face in the sketch.
	oSketch = oFlatPattern.Sketches.Add(oFace, False)
   
    ' Change the name.
    oSketch.Name = sSketchName
	
	' Create a new object collection for the hole center points.
    oHoleCenters = ThisApplication.TransientObjects.CreateObjectCollection

   	Dim oTG As TransientGeometry
   	oTG = ThisApplication.TransientGeometry	
		
	Dim oPoint As Point2d
    Dim oEdge As Edge
	
	oOffset = oOffset * 2.5400013716 'converts cm to inches

    ' Get all Bend UP edges on top face
    Dim oTopFaceBendUpEdges As Edges
	oTopFaceBendUpEdges = _
	oFlatPattern.GetEdgesOfType(FlatPatternEdgeTypeEnum.kBendUpFlatPatternEdge, True)


    For Each oEdge In oTopFaceBendUpEdges
    	oPoint = oTG.CreatePoint2d(oEdge.StartVertex.Point.x, oEdge.StartVertex.Point.Y - oOffset)
		oHoleCenters.Add ( oSketch.SketchPoints.Add(oPoint, True))
		oPoint = oTG.CreatePoint2d(oEdge.StopVertex.Point.x, oEdge.StopVertex.Point.Y + oOffset)
    	oHoleCenters.Add ( oSketch.SketchPoints.Add(oPoint, True))
    Next
	
    ' Get all Bend DOWN edges on top face
    Dim oTopFaceBendDownEdges As Edges
    oTopFaceBendDownEdges = _
	oFlatPattern.GetEdgesOfType(FlatPatternEdgeTypeEnum.kBendDownFlatPatternEdge, True)
	
	For Each oEdge In oTopFaceBendDownEdges
    	oPoint = oTG.CreatePoint2d(oEdge.StartVertex.Point.x, oEdge.StartVertex.Point.Y - oOffset)
		oHoleCenters.Add ( oSketch.SketchPoints.Add(oPoint, True))
		oPoint = oTG.CreatePoint2d(oEdge.StopVertex.Point.x, oEdge.StopVertex.Point.Y + oOffset)
    	oHoleCenters.Add ( oSketch.SketchPoints.Add(oPoint, True))
    Next
	
	
	
	'set a reference to the transient geometry collection.
Dim oTransGeom As TransientGeometry
oTransGeom = ThisApplication.TransientGeometry

' Create a new transaction to wrap the construction of the three lines
' set into a single undo.
Dim oTrans As Transaction
oTrans = ThisApplication.TransactionManager.StartTransaction( _
ThisApplication.ActiveDocument, _
"Create Triangle Sample")

' Create the first line of the triangle. This uses two transient points as
' input to definethe coordinates of the ends of the line. Since a transient
' point is input a sketch point is automatically created at that location and
' the line is attached to it.
Dim oLines(0 To 2) As SketchLine
oLines(0) = oSketch.SketchLines.AddByTwoPoints(oTransGeom.CreatePoint2d(oEdge.StartVertex.Point.x , oEdge.StartVertex.Point.Y - oOffset), _
oTransGeom.CreatePoint2d(oEdge.StartVertex.Point.x -0.5, oEdge.StartVertex.Point.Y - oOffset + 0.5))

' Create a sketch line that is connected to the sketch point the previous lines
' end point is connected to. This will automatically create the constraint to
' tie the new line to the sketch point the previous line is also connected to.
' This will result in the the two lines being connected since they're both tied
' to the same sketch point.
oLines(1) = oSketch.SketchLines.AddByTwoPoints(oLines(0).EndSketchPoint, _
oTransGeom.CreatePoint2d(oEdge.StartVertex.Point.x +0.5, oEdge.StartVertex.Point.Y - oOffset + 0.5))

' Create a third line and connect it to the start point of the first line and the
' end point of the second line. This will result in a connected triangle.
oLines(2) = oSketch.SketchLines.AddByTwoPoints(oLines(1).EndSketchPoint, oLines(0).StartSketchPoint)

Dim oProfile As Profile
oProfile = oSketch.Profiles.AddForSolid
    
Dim oCutDefinition As CutDefinition
oCutDefinition = oFlatPattern.Features.CutFeatures.CreateCutDefinition(oProfile)

Call oCutDefinition.SetThroughAllExtent(kNegativeExtentDirection)

Dim oCutFeature As CutFeature
oCutFeature = oFlatPattern.Features.CutFeatures.Add(oCutDefinition)


' End the transaction
oTrans.End

iLogicVb.UpdateWhenDone = True
0 Likes
Message 7 of 13

philip1009
Advisor
Advisor

Okay, that's what I figured was going on, just wanted to make sure.  I'm guessing your main problem is that if you change the folded model enough, you lose all association for sketches in the flat pattern and having to redo all of that work.  Instead you could use the Unfold tool to flatten the folded model, then add your notches the same as you would on the flat pattern, then Refold back to the folded model, just make sure you delete the Flat Pattern first otherwise Inventor will error out for sure.  Doing this makes flat pattern edits more stable and adaptive to changes in the folded model, it's just a matter of whether or not Inventor will accept the edits.

 

Other than that, you're correct, Inventor doesn't have the functionality to add relief notches to single bends the same way as corner notches.  Sounds like another good idea for the Inventor Ideas forum.

0 Likes
Message 8 of 13

Anonymous
Not applicable

@philip1009

 

Yes, we could use that method, however most of our products are custom so we chose to utilize the flat pattern as it requires less steps (faster). Thank you for the suggestion.

 

@GeorgK

 

Your method is close to what I need. Ideally, I need the points of the triangle to be constrained to the bend lines, which varies with the thickness of the material and its bend radius. Moreover, I could only get a single triangle to sketch, rather than for each end of the bend lines. 

0 Likes
Message 9 of 13

GeorgK
Advisor
Advisor

@Anonymous

That's a sample code for one triangle. You can create the other ones similar.

 

To learn programming you can use the help-file:

 

C:\Users\Public\Documents\Autodesk\Inventor 2019\Local Help\admapi_23_0.chm

0 Likes
Message 10 of 13

Aksedition
Explorer
Explorer

Same thing I need to create on bend lines of  flat pattern, but not able to do that. I want to add these notches on endpoint of every bend line when flat pattern created. Can anyone help to do that. I also attached part file of same.

 

 

endpoint 1.jpg2.jpg3.jpg

@chrisw01a @GeorgK I seen you post, you did similar thing through ilogic. 

0 Likes
Message 11 of 13

cnewmanVIK
Advocate
Advocate

I created an idea on the idea board in case you guys want to vote it up.

 

Add notches to bend lines for manufacturing - Autodesk Community

0 Likes
Message 12 of 13

Rich-T
Advocate
Advocate

I suggest creating a punch for the 'triangles' - it can then easily be sized to suit your materials.

Using the punch tool in flat pattern is quick - ish.

Then you can try programmatically projecting all the bend lines on to the flat pattern sketch & you're almost there.

0 Likes
Message 13 of 13

Rich-T
Advocate
Advocate

Also, have a look at Curtis solution to this thread.

 

Solved: Automated hole creation on bend lines - Autodesk Community - Inventor

0 Likes