fifiririloulou
Agricultural
- Apr 8, 2008
- 33
Hi everyone,
I have a welded part with a "Structural Member1" that contains 2 groups of 2 segments each, and
I would like to delete/remove one of the group. (and/or remove one segment in one of the groups)
I have found one macro to create a weldment, and one to modify the profil, but none for that. Anyone has an idea?
So far I have this macro that gives me the number of groups and their number of segments:
I have a welded part with a "Structural Member1" that contains 2 groups of 2 segments each, and
I would like to delete/remove one of the group. (and/or remove one segment in one of the groups)
I have found one macro to create a weldment, and one to modify the profil, but none for that. Anyone has an idea?
So far I have this macro that gives me the number of groups and their number of segments:
Code:
Dim swApp As Object
Dim swPart As Object
Dim boolstatus As Boolean
Dim swWeldFeat As Feature
Dim swWeldFeatData As StructuralMemberFeatureData
Dim group As StructuralMemberGroup
Dim vgroups As Variant
Sub main()
Set swApp = Application.SldWorks
Set swPart = swApp.ActiveDoc
boolstatus = swPart.Extension.SelectByID2("Structural Member1", "BODYFEATURE", 0, 0, 0, False, 0, Nothing, 0)
Set swWeldFeat = swPart.SelectionManager.GetSelectedObject6(1, 0)
Set swWeldFeatData = swWeldFeat.GetDefinition
boolstatus = swWeldFeatData.AccessSelections(swPart, Nothing)
Debug.Print swWeldFeatData.GetGroupsCount()
vgroups = swWeldFeatData.Groups
Set group = vgroups(0)
Debug.Print group.GetSegmentsCount
Set group = vgroups(1)
Debug.Print group.GetSegmentsCount
boolstatus = swWeldFeat.ModifyDefinition(swWeldFeatData, swPart, Nothing)
End Sub