Hi friends , I need a method or macro to select all planar surface in the same time in the tree manager like in the picture enclosed.thnaks in advance
try this one:
Dim swApp As SldWorks.SldWorks
Dim swFeat As SldWorks.Feature
Dim swModel As SldWorks.ModelDoc2
Dim sFeatType As String
Set swApp = Application.SldWorks
Set swModel = swApp.ActiveDoc
Set swFeat = swModel.FirstFeature
Do While Not swFeat Is Nothing
swFeatTYpe = swFeat.GetTypeName2
If swFeat.GetTypeName2 = "PlanarSurface" Then
swFeat.Select2 True, -1
Set swFeat = swFeat.GetNextFeature
thank you my friend for your answer. the problem rhat like you see in the picture in attachement. the name of the planarsurface is like this : surface_plan1,surface-plan2 , ....its possible to select them with oncrementation i =1 to ... ? thank you
Why you need a macro and why can't you shift select them?
Agreed with Deepak,
go to surfaceBodies folder and select all
Can you use the Power Select tool, found in the location indicated in the image below?
Then select Feature Type, Surfaces>Planar, hit Search then when you close out of Power Select the Planar surfaces will be selected.
thank you very much all my friends for your help. you all help me very good . Also I would like to thanks Amen Allah Jlili for his support and help.Thank you
Hi friends, I tried to use this macro to select surfaces (planar surfaces ) in part doc and it works very good. but when I trid to use it in assembly it does not work. I have an assembly , the part called "P VERT-2 ". how can I modify this macro to make it work in assembly.thank you very much
THIS IS THE MACRO :
Dim vFeatures As Variant
Set swSelMgr = swModel.SelectionManager
Set swSelData = swSelMgr.CreateSelectData
vFeatures = swModel.FeatureManager.GetFeatures(False)
For Each Feat In vFeatures
If Feat.GetTypeName2 = "PlanarSurface" Then
Retrieving data ...