Community
Inventor Forum
Welcome to Autodesk’s Inventor Forums. Share your knowledge, ask questions, and explore popular Inventor topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

iLogic to turn off ALL sketches vibibility

8 REPLIES 8
SOLVED
Reply
Message 1 of 9
Josy05
1987 Views, 8 Replies

iLogic to turn off ALL sketches vibibility

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,

 

 

 

Josee Laplante
BIM Drafting Technician

AutoCAD 2016
Inventor Professional 2016
Vault Professional 2016
Revit 2014
8 REPLIES 8
Message 2 of 9
mdavis22569
in reply to: Josy05

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

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

---------
Mike Davis

EESignature

Message 3 of 9


@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

Message 4 of 9
Curtis_Waguespack
in reply to: Josy05

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

Message 5 of 9
Josy05
in reply to: Curtis_Waguespack

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.

 

 

Josee Laplante
BIM Drafting Technician

AutoCAD 2016
Inventor Professional 2016
Vault Professional 2016
Revit 2014
Message 6 of 9
Josy05
in reply to: Josy05

I found it on my own and the answer was on your blog.

Josee Laplante
BIM Drafting Technician

AutoCAD 2016
Inventor Professional 2016
Vault Professional 2016
Revit 2014
Message 7 of 9
DClunie1
in reply to: Josy05

Will this code work at assembly level.

 

Can it switch off on all parts found ??

Message 8 of 9

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.

Message 9 of 9
johnsonshiue
in reply to: darrell.wcd

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!



Johnson Shiue (johnson.shiue@autodesk.com)
Software Test Engineer

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report