To know if the Plane is used in assembly or not
To know if the Plane is used in assembly or not
(OP)
Hi,
I have a part that is been used in several assemblies. This part has a Reference Plane with not children (Meaning nothing lists as childeren in the parent/child box).
As I mentioned that this part was used in several assemblies, is there a way to know if this plane was ever used in any assemblies for mates or incontext features for other parts?
Thanks
BT
I have a part that is been used in several assemblies. This part has a Reference Plane with not children (Meaning nothing lists as childeren in the parent/child box).
As I mentioned that this part was used in several assemblies, is there a way to know if this plane was ever used in any assemblies for mates or incontext features for other parts?
Thanks
BT






RE: To know if the Plane is used in assembly or not
A simple method is to suppress the plane in the part, and then open all the assys the part is used in. If no errors appear you are probably safe to delete the plane. As always make back-ups first.
RE: To know if the Plane is used in assembly or not
Deepak Gupta
SW2009 SP3.0
SW2007 SP5.0
MathCAD 14.0
RE: To know if the Plane is used in assembly or not
You read my mind. I found that macro same time as you.
Chris
SolidWorks 09 SP4.1
ctopher's home
SolidWorks Legion
RE: To know if the Plane is used in assembly or not
Deepak Gupta
SW2009 SP3.0
SW2007 SP5.0
MathCAD 14.0
RE: To know if the Plane is used in assembly or not
RE: To know if the Plane is used in assembly or not
Thanks
Deepak Gupta
SW2009 SP3.0
SW2007 SP5.0
MathCAD 14.0
RE: To know if the Plane is used in assembly or not
Sorry to ask this simple question. You adviced me to modify this macro to work in a assembly. I edited the macro and modified it to Assly.
1. Should I run this in the assly?
2. Can I run it in the part also?
My main intension is to determine, if I can safely delete few planes if they arent needed by any other assemblies.
Modified code : (Poor editing, used kind of replace word)
Dim swApp As Object
Dim Assly As Object
Dim SelMgr As Object
Sub deleteplanes()
Dim SubFeatObj As Object
Dim FeatObj As Object
Dim FeatType As String
Dim retval As Variant
Set FeatObj = Part.FirstFeature
Do While Not FeatObj Is Nothing
FeatType = FeatObj.GetTypeName
If FeatType = "RefPlane" And FeatObj.Name <> "Front" _
And FeatObj.Name <> "Top" And FeatObj.Name <> "Right" _
Then 'a sketch - select it
retval = FeatObj.GetChildren()
If IsEmpty(retval) Then
Part.AndSelectByID FeatObj.Name, "PLANE", 0, 0, 0
End If
End If
Set FeatObj = FeatObj.GetNextFeature
Loop
Part.DeleteSelection (False)
End Sub
Sub main()
Set swApp = CreateObject("SldWorks.Application")
Set Assly = swApp.ActiveDoc
If (Assly Is Nothing) Then
swApp.SendMsgToUser2 _
"No Active Assly !! " _
, swMbWarning, swMbOk
Exit Sub
End If
If (Assly.GetType <> 1) Then ' If not an assembly or parts, then exit
swApp.SendMsgToUser2 "Only for use with parts.", swMbWarning, swMbOk
Exit Sub
End If
Set SelMgr = Part.SelectionManager() ' Get the selection manager object
Assly.ClearSelection
Call deleteplanes
End Sub
RE: To know if the Plane is used in assembly or not
You should be able to suppress them safely without worrying. If they are needed later you can bring them back if you see a Mate is missing a reference it will be called out.
otherwise a Suppressed feature is just like a deleted one because it isn't considered as being there when the part or assembly is rebuilt. It's always best to use the Default Reference Planes for mates in an assembly because they do not require a part rebuild to be solved like created datums or faces do.
If you designed a part of the default planes different then how you plan to mate it you can have one config with the part as built to use for drawings and another for Assembly where you can use Move Body to position it as you'd like to mate it in an assembly using the default planes.
Michael