iLogic - Hide workplanes before save document

iLogic - Hide workplanes before save document

alexandre
Enthusiast Enthusiast
537 Views
2 Replies
Message 1 of 3

iLogic - Hide workplanes before save document

alexandre
Enthusiast
Enthusiast
 

View > Visibility > Object Visibility
Descrição:
When saving parts and assemblies, I would like User Workplanes to always be hidden.

We have a keyboard shortcut "Alt + [", however, I would like to leave the active option of Work Plans always hidden.

I share:

 

"Dear Alexandre Vieira,

Create a rule with below iLogic code and add to "Before Save Document" event triggers (For reference https://www.youtube.com/watch?v=h38GRrDdfjs).

 

Dim doc As Document
doc = ThisApplication.ActiveDocument  

Dim odef As ComponentDefinition
odef = doc.ComponentDefinition 

Dim p As WorkPlane
For Each p In odef.Workplanes 
p.Visible= False       
Next

 doc.Save()


Best Regards,

CHANDRA SHEKAR G"

0 Likes
538 Views
2 Replies
Replies (2)
Message 2 of 3

WCrihfield
Mentor
Mentor

Was there a question?

Does that code not work for you?

That code should work just fine for part documents.

But when dealing with assemblies, you have to keep the "DesignViewRepresentation" in mind.

If the active DesignViewRepresentation is the Master one or a locked one, it will not save those changes.

You need to make sure the active DesignViewRepresentation is an unlocked one, before it will save changes to Visibility.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes
Message 3 of 3

alexandre
Enthusiast
Enthusiast

There is no question,

I just wanted to share a solution that was passed on to me and I wanted to share it with the group.
My need was only for parts.

 

I am also aware of the Design View Representation.

Thank you for your concern,

0 Likes