Hi,
I know this subject as been posted often but I can't seem to find exactly what i'm looking for.
I need some help on creating an iLogic code to put ALL sketches visibility at off in an assembly once we are done. I know that ALL is a concept too large but can I define a list of sketch names? We have establish (sort of) a naming convention for principal sketches but I'm sure users can reverse words or use capital letters or what ever... Can I say to look for skecthes containing certain words or I need to be specific for the rule to work properly?
I found useful threads but I don't know how to adapt the code for my needs.
Thanks,
Solved! Go to Solution.
Solved by Curtis_Waguespack. Go to Solution.
@michaeldavis7418 wrote:
I don't know the code for it ...however You know you can go right to View, Object Visibility and click all work features and that'll do it too
Hi michaeldavis7418,
Just a reminder that using the View > Object Visibility option sets an override, but does not actually toggle the sketch visibiltiy on/off option.
Josy05,
I'll look for some iLogic code to do this later, when I have a moment.
I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com
Hi Josy0,
Here is the iLogic code to turn off the visibility of all the 2D sketches in the part:
Dim doc As PartDocument doc = ThisDoc.Document Dim oSketch As PlanarSketch For Each oSketch In doc.ComponentDefinition.Sketches oSketch.Visible = False Next
I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com
Thanks Curtis, your version of the code is simpler and works perfectly.
At first I thought of adding a message box to warn the users then I said why not give the choice. Is that possible? Can I have active button permitting the users not to close the sketch visibility is they desire? Because at the moment Yes or No does no make a difference, the sketches will turn off anyway.
is it possible to do this from an assembly level?
that way i can create a trigger that will turn the sketches in all parts off.
Hi! Just in case you were not aware of Object Visibility. You can go to View -> Object Visibility -> turn off all objects at the assembly level. Please note that the change only applies to the the assembly. The objects may still be visible within their documents or other documents.
Many thanks!