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: 

how to create dogbones with ilogic

28 REPLIES 28
Reply
Message 1 of 29
paul
4187 Views, 28 Replies

how to create dogbones with ilogic

Hello,

 

Could anybody please help me create some code for creating dogbones on our sheetmetal parts? I would like the code to  look at the flat pattern and find all the inside corners and blow a hole and rounded edges into them. 

 

How could i do this? 

 

Any advise would be greatly appreciated, 

 

Thanks, 

28 REPLIES 28
Message 2 of 29
Thomas_Savage
in reply to: paul

Hello @paul

 

For iLogic problems post in the Inventor Customization forum.

 

https://forums.autodesk.com/t5/inventor-customization/bd-p/120

 

You will get better help there.

 

I have asked for this to be moved there.

 

Hope you get the answer to your problem.

 

Thomas.



Thomas Savage

Design Engineer


Message 3 of 29
paul
in reply to: Thomas_Savage

@Curtis_Waguespack - do you have any advice for the question i posed above. 

Message 4 of 29
Curtis_Waguespack
in reply to: paul

Hi @paul,

 

Can you provide a picture or example part file showing the feature you wish to automate the creation of?

 

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

Message 5 of 29

See this link for more info:

 

https://forums.autodesk.com/t5/fusion-360-ideastation-request-a/dog-bone-filets-for-cnc-joinery/idc-...

 

It's to modify internal profiles that are designed for slot + tab fits so that the internal radius on the slot doesn't interfere with the tab + has clearance.


--------------------------------------
Did you find this reply helpful ? If so please use the 'Accept as Solution' or 'Like' button below.

Justin K
Inventor 2018.2.3, Build 227 | Excel 2013+ VBA
ERP/CAD Communication | Custom Scripting
Machine Design | Process Optimization


iLogic/Inventor API: Autodesk Online Help | API Shortcut In Google Chrome | iLogic API Documentation
Vb.Net/VBA Programming: MSDN | Stackoverflow | Excel Object Model
Inventor API/VBA/Vb.Net Learning Resources: Forum Thread

Sample Solutions:Debugging in iLogic ( and Batch PDF Export Sample ) | API HasSaveCopyAs Issues |
BOM Export & Column Reorder | Reorient Skewed Part | Add Internal Profile Dogbones |
Run iLogic From VBA | Batch File Renaming| Continuous Pick/Rename Objects

Local Help: %PUBLIC%\Documents\Autodesk\Inventor 2018\Local Help

Ideas: Dockable/Customizable Property Browser | Section Line API/Thread Feature in Assembly/PartsList API Static Cells | Fourth BOM Type
Message 6 of 29
paul
in reply to: MechMachineMan

@MechMachineMan -  I do use this add-in for Fusion - it is not to powerful - from experience I think that it does not activate with a Fusion assembly, however the idea is awesome. But I can not use this code for Inventor- correct? 

 

@Curtis_Waguespack - please find image attached. Let me know if this is clear - thanks, 

 

Male- Tab - part.JPGCapture.JPGPunched part trans parent.JPG

Message 7 of 29
Curtis_Waguespack
in reply to: paul

Hi @paul,

 

So are you like the user at this link, who wants to create the round corners on any slots, or are you wanting to create the slot and dogbone all at once?

https://forums.autodesk.com/t5/inventor-forum/creating-cnc-dog-bone-with-ifeature/td-p/6004389

 

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

Message 8 of 29

Also, if I look at the photo at that link and compare it to your screen shots it appears the centers of the relief holes are placed differently?

Message 9 of 29
paul
in reply to: Curtis_Waguespack

Hello @Curtis_Waguespack,

 

I have been looking at this post for a while now and I shied away from it because i do not want the i-Feature, for the simple reason - every hole size is different - and how do i create an i-feature that follows that, and i do not only need the dog-bone for the female end, but also for the male end so the rounded edge does not interfere with the second part that it butts on to.

 

Please let me know on your thoughts, 

Message 10 of 29
paul
in reply to: Curtis_Waguespack

That is correct, it is really the methodology of placing the feature, he is using a slot to create the relief - where i am using a hole. And if you look at the fusion add-in they also use a hole, but the perimeter of the hole is at the edge of the square slot vs. the center of the hole at corner of slot...

 

The slot method is very standard and gives you a bit more flexibility in thin sheet-metal. 

 

Let me know if this is clear, thanks for your efforts, 

Message 11 of 29
paul
in reply to: paul

@DRoam - what are your thoughts on this?

Message 12 of 29
Curtis_Waguespack
in reply to: paul

Hi @paul,

 

Here is an attached 2017 file with a quick attempt at this with iLogic. As written currently the holes are placed directly on the vertex.

 

It's still not clear to me if you are attempting to automate the placement of the holes as in this example, or complete dogbone cutouts and tabs. 

 

In any case you play around with the example and provide feedback , and if time permits and someone hasn't provided a solution already, I'll try to have another look at some point.

 

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

Message 13 of 29
rhasell
in reply to: paul

Following.

 

I used to do it all manually. (Current company does not subscribe to keyed plates, so I don't do it anymore)

 

But one thing I do remember is that there are a set of rules based on the laser/plasma, and the plate thickness, the minimum radius for the holes and fillets change based on the plate thickness, so I guess something to keep in mine when developing the code.

 

Reg
2024.2
Please Accept as a solution / Kudos
Message 14 of 29
paul
in reply to: rhasell

what are keyed plates?

Message 15 of 29
paul
in reply to: Curtis_Waguespack

@Curtis_Waguespack - i think this is a real good start, can you have it look for all inside corners and punch the hole? and then round all the corners?

 

I am only looking to create the holes and the rounded edges, nothing to do with the tabs - i need to do that manually. 

 

Thanks for your time and effort, please let me know if this is clear, 

Message 16 of 29
rhasell
in reply to: paul

I guess my terminology is incorrect, but creating a a corresponding pin to slot takes all the thinking out of assembly, there is no measuring to be done, just plug and play, (Weld in this case)

 

Reg
2024.2
Please Accept as a solution / Kudos
Message 17 of 29
MechMachineMan
in reply to: paul

Kudos to @Curtis_Waguespack for gettting a solid start to the code.

 

@paul... careful what you wish for and how you word it... Smiley Very Happy

 

Note, the code below is in VBA so it was easier to code and can be added to a keyboard shortcut easily.

 

Also Note, you can see it has mod values based on plate thickness so it automatically figures out the size (I don't know of many laser cutters who would cut holes too much smaller than plate thickness, so I just made the diam slightly larger as default.

 

Note: It does all of the internal edge loops. So if you have internal edges that don't meet at 90, it will dogbone those too. To fix it if you run into issues with that, you can always edit the hole feature and "un-click" the points you don't want dogbones and it should remove them and their fillets without error.

 

Good luck!

 

Sub Main()
    Dim oSheetMetalDoc As PartDocument
    Set oSheetMetalDoc = ThisApplication.ActiveEditDocument
    
    Dim oCompDef As SheetMetalComponentDefinition
    Set oCompDef = oSheetMetalDoc.ComponentDefinition
    
    Dim oSheetMetalFeatures As SheetMetalFeatures
    Set oSheetMetalFeatures = oCompDef.Features
    
    Dim oThickness As Double
    oThickness = 0
    
    On Error Resume Next
        oThickness = oCompDef.Parameters("Thickness").Value
        If oThickness = 0 Then
            MsgBox ("Thickness not found in Params!" & vbLf & vbLf & "Please manually enter!")
            oThickness = InputBox("Enter plate thickness in mm" & vbLf & vbLf & "[This will be used to calculate dogbone diam]", "iLogic", "0.5")
        End If
    On Error GoTo 0
    
    If oThickness = 0 Then
        Exit Sub
    End If
    
    oDogBoneDiamPercentOfThickness = 1.125
    oFilletPercentOfDiam = 0.25
    
    oDiam = oDogBoneDiamPercentOfThickness * oThickness
    oFilletSize = oFilletPerCentOfDiam & "*" & oDiam
    
    Dim oFace As Face
    
    Do
        Set oFace = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kPartFaceFilter, "Select the top FACE")
    Loop While oFace Is Nothing
    
    Dim oRoughDogBoneSketch As Sketch
    Set oRoughDogBoneSketch = oCompDef.Sketches.Add(oFace, False)
    
    Dim oEdge As Edge
    Dim oEdgeLoop As EdgeLoop
    
    Dim oSketchPointCollection As ObjectCollection
    Set oSketchPointCollection = ThisApplication.TransientObjects.CreateObjectCollection
    
  On Error Resume Next
    For Each oEdgeLoop In oFace.EdgeLoops
        If oEdgeLoop.IsOuterEdgeLoop = False Then
            For Each oEdge In oEdgeLoop.Edges
                Set oHole1 = Nothing
                Set oHole2 = Nothing
                
                Set oHole1 = oRoughDogBoneSketch.AddByProjectingEntity(oEdge.StartVertex)
                Set oHole2 = oRoughDogBoneSketch.AddByProjectingEntity(oEdge.StopVertex)
                
                If Not oHole1 Is Nothing Then
                    oSketchPointCollection.Add oHole1
                End If
                
                If Not oHole2 Is Nothing Then
                    oSketchPointCollection.Add oHole2
                End If
            Next
        End If
    Next
  On Error GoTo 0

    Dim oSketchPlacementDefinition As SketchHolePlacementDefinition
    Set oSketchPlacementDefinition = oCompDef.Features.HoleFeatures.CreateSketchPlacementDefinition(oSketchPointCollection)

    Call oCompDef.Features.HoleFeatures.AddDrilledByThroughAllExtent(oSketchPlacementDefinition, oDiam, kPositiveExtentDirection)
    
 'AddFillets
    
    Dim oCircleEdges As EdgeCollection
    Set oCircleEdges = ThisApplication.TransientObjects.CreateEdgeCollection
    
    Dim oCircFace As Face
    Dim oCircEdge As Edge
    
  On Error Resume Next
    For Each oEdgeLoop In oFace.EdgeLoops
        If oEdgeLoop.IsOuterEdgeLoop = False Then
            For Each oEdge In oEdgeLoop.Edges
                If oEdge.GeometryType = kCircularArcCurve Then
                    For Each oCircFace In oEdge.Faces
                        If oCircFace.SurfaceType = kCylinderSurface Then
                            For Each oCircEdge In oCircFace.Edges
                                If oCircEdge.CurveType <> kCircleCurve Then
                                    oCircleEdges.Add oCircEdge
                                End If
                            Next
                        End If
                    Next
                End If
            Next
        End If
    Next
  On Error GoTo 0

    Call oCompDef.Features.FilletFeatures.AddSimple(oCircleEdges, oFilletSize)
    
End Sub

--------------------------------------
Did you find this reply helpful ? If so please use the 'Accept as Solution' or 'Like' button below.

Justin K
Inventor 2018.2.3, Build 227 | Excel 2013+ VBA
ERP/CAD Communication | Custom Scripting
Machine Design | Process Optimization


iLogic/Inventor API: Autodesk Online Help | API Shortcut In Google Chrome | iLogic API Documentation
Vb.Net/VBA Programming: MSDN | Stackoverflow | Excel Object Model
Inventor API/VBA/Vb.Net Learning Resources: Forum Thread

Sample Solutions:Debugging in iLogic ( and Batch PDF Export Sample ) | API HasSaveCopyAs Issues |
BOM Export & Column Reorder | Reorient Skewed Part | Add Internal Profile Dogbones |
Run iLogic From VBA | Batch File Renaming| Continuous Pick/Rename Objects

Local Help: %PUBLIC%\Documents\Autodesk\Inventor 2018\Local Help

Ideas: Dockable/Customizable Property Browser | Section Line API/Thread Feature in Assembly/PartsList API Static Cells | Fourth BOM Type
Message 18 of 29
paul
in reply to: MechMachineMan

Hello Justin, Thanks for your efforts and time!!! 

 

please see the message attached - i am getting some Set errors.

 

Capture.JPG

Message 19 of 29
paul
in reply to: MechMachineMan

Hello Justin,

 

I got the rule running - Thanks a billion!!! What would i have to change to capture all the inside corners of any sheetmetal part?

Message 20 of 29
MechMachineMan
in reply to: paul

Are you talking interior corners on various different flanges?

 

Run the rule for each face is the easy answer.... The more difficult answer is that you would need to create an algorithm to cycle through the faces and check if the face has dogbones already.


--------------------------------------
Did you find this reply helpful ? If so please use the 'Accept as Solution' or 'Like' button below.

Justin K
Inventor 2018.2.3, Build 227 | Excel 2013+ VBA
ERP/CAD Communication | Custom Scripting
Machine Design | Process Optimization


iLogic/Inventor API: Autodesk Online Help | API Shortcut In Google Chrome | iLogic API Documentation
Vb.Net/VBA Programming: MSDN | Stackoverflow | Excel Object Model
Inventor API/VBA/Vb.Net Learning Resources: Forum Thread

Sample Solutions:Debugging in iLogic ( and Batch PDF Export Sample ) | API HasSaveCopyAs Issues |
BOM Export & Column Reorder | Reorient Skewed Part | Add Internal Profile Dogbones |
Run iLogic From VBA | Batch File Renaming| Continuous Pick/Rename Objects

Local Help: %PUBLIC%\Documents\Autodesk\Inventor 2018\Local Help

Ideas: Dockable/Customizable Property Browser | Section Line API/Thread Feature in Assembly/PartsList API Static Cells | Fourth BOM Type

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

Post to forums  

Technology Administrators


Autodesk Design & Make Report