How to Select Base Flange Sketch
How to Select Base Flange Sketch
(OP)
Hi,
I am in a situation where I need to select the base flange sketch. I have code to select "Sketch 1" but I don't know if the base flange will always be sketch 1.
Part.SelectByID "Sketch1", "SKETCH", 0, 0, 0
Could somebody help with this ? Thanks.
I am in a situation where I need to select the base flange sketch. I have code to select "Sketch 1" but I don't know if the base flange will always be sketch 1.
Part.SelectByID "Sketch1", "SKETCH", 0, 0, 0
Could somebody help with this ? Thanks.






RE: How to Select Base Flange Sketch
-handleman, CSWP (The new, easy test)
RE: How to Select Base Flange Sketch
RE: How to Select Base Flange Sketch
RE: How to Select Base Flange Sketch
RE: How to Select Base Flange Sketch
-handleman, CSWP (The new, easy test)
RE: How to Select Base Flange Sketch
RE: How to Select Base Flange Sketch
RE: How to Select Base Flange Sketch
RE: How to Select Base Flange Sketch
Dim swDoc As SldWorks.ModelDoc2
Dim swFeat As SldWorks.Feature
Dim swSubFeat As SldWorks.Feature
Sub main()
Set swapp = Application.SldWorks
Set swDoc = swapp.ActiveDoc
Set swFeat = swDoc.FirstFeature
Do While Not (swFeat Is Nothing)
If (swFeat.GetTypeName2 = "SMBaseFlange") Or (swFeat.GetTypeName2 = "LoftedBend") Then
Set swSubFeat = swFeat.GetFirstSubFeature
Do While Not (swSubFeat Is Nothing)
If swSubFeat.GetTypeName2 = "ProfileFeature" Then
swSubFeat.Select2 True, 1
End If
Set swSubFeat = swSubFeat.GetNextSubFeature
Loop
End If
Set swFeat = swFeat.GetNextFeature
Loop
End Sub
-handleman, CSWP (The new, easy test)
RE: How to Select Base Flange Sketch
I want to select the sketch that was used to create the Base Flange.
Example: The user makes a sketch and uses the sketch to make a plane. Now the user selects that plane and makes a sketch on it and uses that sketch to create the base flange so in the feature manager tree you have 2 sketches. How will the macro know which sketch is the sketch used to create the base flange ?
RE: How to Select Base Flange Sketch