noelieboy
Bioengineer
- Jan 24, 2004
- 6
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