Community
Inventor Forum
Welcome to Autodesk’s Inventor Forums. Share your knowledge, ask questions, and explore popular Inventor topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Automated hole creation on bend lines

36 REPLIES 36
SOLVED
Reply
Message 1 of 37
chrisw01a
2998 Views, 36 Replies

Automated hole creation on bend lines

Hope you all are having a great day.

 

Does anyone here know if it would be possible to use iLogic or other means to build an addon that will find the bend line on a flat pattern and add two holes to it (one on each end)?

 

The way our CNC machine picks up our centerpunch is we add a .125" hole on the part.  I spends hours opening flat patterns , creating a sketch, projecting the bend lines, adding a point usually .100" away from the edge, then using the hole feature to create the .125" hole.

 

Example part attached.

 

We would probably pay money for it if anyone knows of something existing.

 

Am I just dreaming here?

 

Thanks

Chris

 

Capture.PNG

Tags (2)
36 REPLIES 36
Message 2 of 37
mcgyvr
in reply to: chrisw01a

I don't have any answer but was just curious of why you need/do this?

 

I don't understand this.. "The way our CNC machine picks up our centerpunch"



-------------------------------------------------------------------------------------------
Inventor 2023 - Dell Precision 5570

Did you find this reply helpful ? If so please use the Accept Solution button below.
Maybe buy me a beer through Venmo @mcgyvr1269
Message 3 of 37
chrisw01a
in reply to: mcgyvr

Our nesting software is set to identify the .125 hole as the centerpunch tool.

We do everything up front in Inventor and the nesting software automatically assigns tools to the part to be punched and plasma cut.

The centerpunch marks are for the press brake.

 

Thank you.

Message 4 of 37
mcgyvr
in reply to: chrisw01a

Ok so you mark the start/end of bend lines vs using dimensionally adjusted back/front stops on the press brake..

 

Nice to have such large tolerances... Visual wouldn't cut it for me.. 

 

 

 

 

 



-------------------------------------------------------------------------------------------
Inventor 2023 - Dell Precision 5570

Did you find this reply helpful ? If so please use the Accept Solution button below.
Maybe buy me a beer through Venmo @mcgyvr1269
Message 5 of 37
chrisw01a
in reply to: mcgyvr

Yes, some of our equipment is still from the stone age.  Smiley Surprised

 

Thanks.

Message 6 of 37
chrisw01a
in reply to: chrisw01a

Does anyone have any contacts that you could direct me to to attempt to solve this?

 

TIA

Message 7 of 37

Hi chrisw01a,

 

I think it can be done, based off a quick look at the API. I suspect we could do it with an ilogic rule, but I don't have the time to look into it at the moment.

 

See this link for a similar example:

https://knowledge.autodesk.com/search-result/caas/CloudHelp/cloudhelp/2018/ENU/Inventor-API/files/Fl...

 

You might post on the Inventor Customization forum:
http://forums.autodesk.com/t5/Autodesk-Inventor-Customization/bd-p/120

 

I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com

 

 

Message 8 of 37

@chrisw01a

 

On second glance I don't think this will take too long, I'll try and come up with something here in a bit.

 

I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com

Message 9 of 37

Hi @chrisw01a,

 

Okay here's a quick iLogic rule that creates a sketch on the top face of the flat pattern and then places holes on the ends of each bend (up and down).

 

I'd set this up as an external rule, although the attached 2017 file has it set up as an external rule.

 

I didn't test this much, so you're likely to run across some issues. If so post back.

 

I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com

 

'[ edit these variables as needed
	
	sSketchName = "Flat Pattern Sketch"
	sHoleName = "Locator Holes"
	oOffset = 0.100 in'defines offset from edge of flat pattern
	oDiameter = 0.125 in 'defines hole diameter
	
']	

    '  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 holes
	Dim oHole As HoleFeature
	For Each oHole In oFlatPattern.Features.HoleFeatures
		oHole.Delete
	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

    ' Create the hole feature.
    oHole =  oFlatPattern.Features.HoleFeatures.AddDrilledByThroughAllExtent( _
                            oHoleCenters, oDiameter * 2.5400013716 , kPositiveExtentDirection)

	oHole.Name = sHoleName
	
Message 10 of 37

Curtis

 

Amazing!  So awesome that you took the time to give this some thought!

 

This has been a huge thorn in my side for years.

 

I would be so happy to pay you to refine this.  I would love to learn more about programming but just do not have the time at the moment.

 

So I ran the code on an existing part that I have and it did not create the center points.  I'm going to attach the file here.

It does seem to work very well on the part that you provided though.

 

The other thing that I noticed right away is that the sketch points are not constrained to the bend lines so if the part were to change geometry (which we have a lot of), the rule would have to be re-ran.  Is it possible to project the bend lines and apply coincident constraint and dimensions from the end points of the line?

 

I am just blown away that this was so easy for you to get to this point.  Please let me know how we can proceed to get this refined.

 

Thank you so much.

Chris

Message 11 of 37

For the part that I just uploaded, I just noticed that the points are there, but they are offset from the part out in space for some reason...

Message 12 of 37
karthur1
in reply to: chrisw01a

Try re-running the rule.  You will have to set an iLogic trigger to run at a given time.  Probably use the "Any Model parameter change" as a trigger.

 

Kirk 

 

2017-06-02_0748.png

Message 13 of 37
chrisw01a
in reply to: karthur1

Why did you suggest to re-run the rule?  I don't follow.

 

As far as the trigger, I'll check it out.  Thanks.

Message 14 of 37
karthur1
in reply to: chrisw01a


@chrisw01a wrote:

Why did you suggest to re-run the rule?  I don't follow.

.


Sorry, I missed the post #10 where you posted a part that showed the issue. I converted this part to a sheetmetal part and see the same issue.  

 

The part you posted is a derived part.  Does his code work on the parent part, just curious?

 

Kirk

Message 15 of 37

Hi chrisw01a &  karthur1,

 

I caught this issue after posting yesterday, but wasn't able to determine what the issue was, so I posted a question concerning this on the Inventor Customization Forum, here:

https://forums.autodesk.com/t5/inventor-customization/sketch-on-flat-pattern-issue/m-p/7123910#M7261...

 

I see a response on that thread, but haven't had time to look into it just yet. But I'll try to do so at some point today.

 

I'll post back to this thread when I've had a chance look at this again.

 

I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com

Message 16 of 37
chrisw01a
in reply to: karthur1

No problem.  No it does not work on the parent.  I have tried several different parts with the same result.

 

Thank you.

Message 17 of 37

No problem.  Thanks for the help and will wait to hear back from you.

 

Chris

Message 18 of 37

Hi chrisw01a,

 

I'm still not having much luck with offsetting the holes predictably, but the attached version does behave more predictably in placing them. It's just that it lays them right on the part edges.

 

I don't suppose adding the holes on the edges is acceptable?

 

In any case I'll look at this again when I can, to see if I can determine how to do the offsetting predictably.

 

I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com

Message 19 of 37

Ok.

 

Thanks for your help so far.

 

As far as the holes being on the edge, you are correct, this will not work.

 

If we could get the points constrained to the projected bend lines and .100" in from the end points, then we would be golden.

 

It almost feels like that part of the API has a bug given its behavior...

 

Do you know anyone I could contract to write this?

 

Have a great day.

 

Chris

 

Message 20 of 37

Downloaded your example.  This is SO close!

I am excited.

 

Chris

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

Post to forums  

Autodesk Design & Make Report