Hello
We use a macro that makes the unfolded DXF of sheet metal part. This works well but the sheet metal edges are fragmented on the DXF at each bend (see attached image). This problem hinders the programming of our punching machine.
Do you know a solution to avoid this problem?
Thanks in advance
image_probleme.png
Hello
When you are in the room and you deploy the unfolded function you have a second function and on this one you do a right click and vor if the merge the stops box (something like that because I am not in front of my PC) and uncheck. If this is the case, check this box and do a test and if it is conclusive, you will have to re-register your part models with these parameters.
2 Likes
Thank you for this answer,
This solution works well, but it will be necessary to redo the handling for each existing part. Are there more systematic solutions? (Parameter in the options ; function on the DXF generation macro; modification of this parameter in bulk ; ... ?)
In fact, if you save your part model, it will be good for new creations, but for old parts, normally your programming department should have the old files that they have modified so that they can be used.
1 Like
The majority of the pieces we create are copies of existing parts, so the problem will remain.
Ok but if you take back existing parts it will make you two more clicks to modify it so that the dxf does not pose too much of a problem to the programming department.
1 Like
Hello
You can add the modification of this parameter at the beginning of the macro, look HERE , you should find what you need (IModelDocExtension::SetUserPreference...) with the examples that go well.
Kind regards
Grasse has all your answers, I found IFlatPatternFeatureData with the MergeFace property.
I have to look at how this works, but it seems possible to integrate it into my macro.
Hello
To test with us can you ask a piece and the macro.
may the force be with you.
Thanks to your answers, a bit of research and racking my brains I made a macro that modifies the value of 'merge faces' of the unfolded state (or swFlatPatternFeatureData.MergeFace).
Thank you for your help
Sub main()
Dim SwApp As SldWorks.SldWorks
Dim Part As SldWorks.ModelDoc2
Dim boolstatus As Boolean
Dim swFeature As SldWorks.Feature
Dim swFlatPatternFeatureData As SldWorks.FlatPatternFeatureData
Set SwApp = Application.SldWorks
Set Part = SwApp.ActiveDoc
Set swFeature = Part.FirstFeature
While Not swFeature Is Nothing
If swFeature.GetTypeName = "FlatPattern" Then
Set swFlatPatternFeatureData = swFeature.GetDefinition
If swFlatPatternFeatureData.MergeFace = 1 Then
swFlatPatternFeatureData.MergeFace = False
Else
swFlatPatternFeatureData.MergeFace = True
End If
boolstatus = swFeature.ModifyDefinition(swFlatPatternFeatureData, Part, Nothing)
End If
Set swFeature = swFeature.GetNextFeature
Wend
End Sub
2 Likes