Macro to select all edges connected edge and fillet them all
Macro to select all edges connected edge and fillet them all
(OP)
Hi all,
I have been experimenting with writing a macro to do the following. I want be able to select and edge within solidworks, then play a macro which will then automatically select all connecting edges to my preselected edge and apply a fillet to them all. (The reason is i cannot quickly use the the filletxpert feature, as i have 100's of such junctions to fillet per model.)
If i record a macro while doing this manually, it just records the specific edges based on the endpoints (i think), and records the nodal co-ordinates within the macro, which is no good to me becuase the nodal co-ordinates will be different each time. So, I want it to search for the connecting edges within the macro and then add them edges to the list.
Below is what i have so far created so far and works as follows: If an edge is pre-selected, and play this macro, it will apply a 0.3mm rad fillet to it.
Can anyone help me to expand the code to automatically add all connected edges to what is to be filleted?
Kind regards
Noel
******************************************************************************
Dim swApp As Object
Dim Part As Object
Dim boolstatus As Boolean
Dim longstatus As Long, longwarnings As Long
Sub main()
Set swApp = _
Application.SldWorks
Set Part = swApp.ActiveDoc
Dim currHiddenEdgeSelectionInHLR As Long
currHiddenEdgeSelectionInHLR = swApp.GetUserPreferenceToggle(swUserPreferenceToggle_e.swEdgesHiddenEdgeSelectionInHLR)
swApp.SetUserPreferenceToggle swUserPreferenceToggle_e.swEdgesHiddenEdgeSelectionInHLR, True
swApp.SetUserPreferenceToggle swUserPreferenceToggle_e.swEdgesHiddenEdgeSelectionInHLR, currHiddenEdgeSelectionInHLR
Dim radiiArray23 As Variant
Dim radiis23() As Double
ReDim radiis23(0 To 0) As Double
Dim setBackArray23 As Variant
Dim setBacks23 As Double
Dim pointArray23 As Variant
Dim points23 As Double
radiiArray23 = radiis23
setBackArray23 = setBacks23
pointArray23 = points23
Dim myFeature As Object
Set myFeature = Part.FeatureManager.FeatureFillet(198, 0.0003, 0, 0, (radiiArray23), (setBackArray23), (pointArray23))
End Sub
I have been experimenting with writing a macro to do the following. I want be able to select and edge within solidworks, then play a macro which will then automatically select all connecting edges to my preselected edge and apply a fillet to them all. (The reason is i cannot quickly use the the filletxpert feature, as i have 100's of such junctions to fillet per model.)
If i record a macro while doing this manually, it just records the specific edges based on the endpoints (i think), and records the nodal co-ordinates within the macro, which is no good to me becuase the nodal co-ordinates will be different each time. So, I want it to search for the connecting edges within the macro and then add them edges to the list.
Below is what i have so far created so far and works as follows: If an edge is pre-selected, and play this macro, it will apply a 0.3mm rad fillet to it.
Can anyone help me to expand the code to automatically add all connected edges to what is to be filleted?
Kind regards
Noel
******************************************************************************
Dim swApp As Object
Dim Part As Object
Dim boolstatus As Boolean
Dim longstatus As Long, longwarnings As Long
Sub main()
Set swApp = _
Application.SldWorks
Set Part = swApp.ActiveDoc
Dim currHiddenEdgeSelectionInHLR As Long
currHiddenEdgeSelectionInHLR = swApp.GetUserPreferenceToggle(swUserPreferenceToggle_e.swEdgesHiddenEdgeSelectionInHLR)
swApp.SetUserPreferenceToggle swUserPreferenceToggle_e.swEdgesHiddenEdgeSelectionInHLR, True
swApp.SetUserPreferenceToggle swUserPreferenceToggle_e.swEdgesHiddenEdgeSelectionInHLR, currHiddenEdgeSelectionInHLR
Dim radiiArray23 As Variant
Dim radiis23() As Double
ReDim radiis23(0 To 0) As Double
Dim setBackArray23 As Variant
Dim setBacks23 As Double
Dim pointArray23 As Variant
Dim points23 As Double
radiiArray23 = radiis23
setBackArray23 = setBacks23
pointArray23 = points23
Dim myFeature As Object
Set myFeature = Part.FeatureManager.FeatureFillet(198, 0.0003, 0, 0, (radiiArray23), (setBackArray23), (pointArray23))
End Sub






RE: Macro to select all edges connected edge and fillet them all
Jeff Mirisola, CSWP
Design Manager/Senior Designer
M9 Defense
My Blog
RE: Macro to select all edges connected edge and fillet them all
yes it is, and the filletxpert can select all connected edges, just like i want, but like i said above, the issue i have is that that is too impractical on the large lattice-like models i have where only certain intersections out of the lattice (about 800 out of 3000) are to be filleted. I would have to at each intersection select an edge and then go into the filletexpert, and wait for the floating toolbar to appear and then the "connected" icon to light up, and only then proceed (screen flashes for some time during this) Its not a ridiculous amount of time, but a macro would definetly help.
cheers
Noel
RE: Macro to select all edges connected edge and fillet them all
kind regards
Noel
RE: Macro to select all edges connected edge and fillet them all
James Spisich
Design Engineer, CSWP