Baruch
Mechanical
- Feb 25, 2004
- 13
Hi, what I try to do is to make "Autosize" all the ref. planes in the part as it is done with RMB and "Autosize".
The macro is running without errors but the job is not done.
I would appreciate some help, 10x!
'==========================================The Code======
Sub Main()
Dim swApp As SldWorks.SldWorks
Dim swModel As SldWorks.ModelDoc2
Dim swFeature As SldWorks.feature
Dim rfPl As SldWorks.RefPlaneFeatureData
Set swApp = Application.SldWorks
Set swModel = swApp.ActiveDoc
Set swFeature = swModel.FirstFeature
Do While Not swFeature Is Nothing
Debug.Print swFeature.GetTypeName
If swFeature.GetTypeName = "RefPlane" Then
Set rfPl = swFeature.GetDefinition
rfPl.autoSize = True
End If
Set swFeature = swFeature.GetNextFeature
Loop
MsgBox ("Finish")
End Sub
==================================================
The macro is running without errors but the job is not done.
I would appreciate some help, 10x!
'==========================================The Code======
Sub Main()
Dim swApp As SldWorks.SldWorks
Dim swModel As SldWorks.ModelDoc2
Dim swFeature As SldWorks.feature
Dim rfPl As SldWorks.RefPlaneFeatureData
Set swApp = Application.SldWorks
Set swModel = swApp.ActiveDoc
Set swFeature = swModel.FirstFeature
Do While Not swFeature Is Nothing
Debug.Print swFeature.GetTypeName
If swFeature.GetTypeName = "RefPlane" Then
Set rfPl = swFeature.GetDefinition
rfPl.autoSize = True
End If
Set swFeature = swFeature.GetNextFeature
Loop
MsgBox ("Finish")
End Sub
==================================================