Inventor General Discussion

Inventor General Discussion

Reply
Distinguished Contributor
zdhrichard
Posts: 124
Registered: ‎05-03-2011
Message 1 of 5 (198 Views)
Accepted Solution

Could somebody help to delete unused work plane by using iLogic Rule?

198 Views, 4 Replies
04-09-2014 01:12 PM

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.

Rich

Autodesk Inventor Professional 2013 (64 Bit) SP2
Windows 7 Professional Service Pack 1
Intel(R) Xeon(R) CPU E5645
12.0 GB Memory

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

 

*Expert Elite*
Cadmanto
Posts: 3,264
Registered: ‎12-07-2011
Message 2 of 5 (192 Views)

Re: Could somebody help to delete unused work plane by using iLogic Rule?

04-09-2014 01:22 PM in reply to: zdhrichard

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?

 

check.PNGIf this solved your issue please mark this posting "Accept as Solution".

Or if you like something that was said and it was helpful, Kudoskudos.PNG are appreciated. Thanks!!!! :smileyvery-happy:

 

New EE Logo.PNG

Inventor.PNG     vault.PNG

 

Best Regards,
Scott McFadden
Inventor Professional 2013
(Colossians 3:23-25)

*Expert Elite*
mrattray
Posts: 2,501
Registered: ‎09-13-2011
Message 3 of 5 (189 Views)

Re: Could somebody help to delete unused work plane by using iLogic Rule?

04-09-2014 01:26 PM in reply to: zdhrichard

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.

Mike (not Matt) Rattray

*Expert Elite*
Curtis_Waguespack
Posts: 2,930
Registered: ‎03-08-2006
Message 4 of 5 (162 Views)

Re: Could somebody help to delete unused work plane by using iLogic Rule?

04-09-2014 03:42 PM in reply to: zdhrichard

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

 



  solution.png  Did you find this reply helpful ? If so please use the Accept as Solution or  Kudos button below.





Distinguished Contributor
zdhrichard
Posts: 124
Registered: ‎05-03-2011
Message 5 of 5 (126 Views)

Re: Could somebody help to delete unused work plane by using iLogic Rule?

04-11-2014 01:21 PM in reply to: Curtis_Waguespack

It works!

Thanks lot.

Rich

Autodesk Inventor Professional 2013 (64 Bit) SP2
Windows 7 Professional Service Pack 1
Intel(R) Xeon(R) CPU E5645
12.0 GB Memory
Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.