When I release part, I want to use iLogic rule to automaticly delete unused work plane (no any dependent) in my *.ipt. The useful work plane need to be keep.
I know I can use
workplane.delet
to delete one plane.
The issue is: how to know whether a work plane has no any dependent.
Your help will be much appreciated.
Solved! Go to Solution.
Solved by Curtis_Waguespack. Go to Solution.
Rich,
What is the real issue? Do you have a lot of part files that you inherited and they have excessive work planes and you need to delete them?
Does just turning off the visibility of these work planes not work for you?
If this solved your issue please mark this posting "Accept as Solution".
Or if you like something that was said and it was helpful, Kudos are appreciated. Thanks!!!!
Did you try checking the Dependents property?
Also, for future questions (please, don't double post), these sort of questions tend to get a better response when posted here: Inventor Customization.
Hi zdhrichard,
Here is a quick ilogic example that employs mrattray's suggestion to use the Dependents property to check to see if the plane can be deleted.
I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com
'define document
Dim oDoc As PartDocument
oDoc = ThisDoc.Document
'look at the workplane collection
For Each oWorkPlane In oDoc.ComponentDefinition.WorkPlanes
'skip origin planes
If oWorkPlane.IsCoordinateSystemElement = True Then
'do nothing
Else
'count the dependents of the workplane
i = oWorkPlane.Dependents.Count
'see if the count = 0
If i = 0 Then
oWorkPlane.Delete
Else
'do nothing
End If
End If
Next
It works!
Thanks lot.