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: 

Inventor 2012-ILogic-Sketch visibility

8 REPLIES 8
Reply
Message 1 of 9
Anonymous
1346 Views, 8 Replies

Inventor 2012-ILogic-Sketch visibility

Hi,

 

Can somebody provide me with iLogic code to turn the visibility of a sketch inside a subassembly on/off from the main assembly.

 

Thanks in advance!

8 REPLIES 8
Message 2 of 9
rdyson
in reply to: Anonymous

View / Visibility / Object Visibility should toggle them off



PDSU 2016
Message 3 of 9
Anonymous
in reply to: rdyson

I know that. I was asking for iLogic code to do it from main assembly for a sketch in a sub-assembly.

Message 4 of 9
Anonymous
in reply to: Anonymous

More specifics needed,  do you want to cycle through your parts and turn off a sketch with a particular name in all of your parts?

 

T.S.

Message 5 of 9
Anonymous
in reply to: Anonymous

Yes, I have a sketch name "Sketch_TC" in all of my sub-assemblies. I want to control the visibility of this sketch from the main assembly. This main assembly is used to do certain combinations of all of my sub-assemblies. Let me know if you need further details.

 

Thanks for your time!

Varinder

Message 6 of 9
Anonymous
in reply to: Anonymous

A little more info, to get your code as efficient as possible.

 

 

You stated that the sketch's are in your sub-assemblies.


Are there any sketches in parts?  or just in assemblies?  This can reduce the objects we have to loop through.

 

Do you need the sketch controlled for each occurance?

 

We can cylce through each unique sub assy refrenced by the main assembly, or we can cycle each and every occurance of the sub assy's.

 

T.S.

 

 

 

 

 

Message 7 of 9
Anonymous
in reply to: Anonymous

Here ya go.

 

This will turn off any sketch named Sketch_TC in any part or sub assy that exists in your main assy.

 

 

T.S.

Message 8 of 9
mrattray
in reply to: Anonymous

That's a clever bit of code there. I never thought to have a sub call itself before.
Mike (not Matt) Rattray

Message 9 of 9
Anonymous
in reply to: mrattray

Thank's

 

It's hard to find a clear and simple routine for cycling through parts and components.

 

I was thinking of posting a few simple cycle loops for everyone to use. (they keep being requested, or at least needed in most of the iLogic requests) as most of the actions people want to preform with iLogic, are usually run on multiple objects.

I was dissapointed to find, or I should say "not find" resources for this in the help file, just bits and pieces.

 

I have one for cycling all component occurances in an assy. (attached in this thread)

I have one for cycling through all items in a bom.

I have one for cycling all documents refrenced by an assy.

I have one to cycle all files in a system directory.

 

Armed with the four,  you can pretty much run iLogic on anything you want, just add in the action to preform.

 

 

And I can't take all the credit, I found the basis for that code somewhere, took a while to dig up.

T.S.

 

PS:  If you have an empty assy it may think its a part.  So really you should have a proper routine to check if its a true part or asssy.  This just psudo checks based on existence of sub occourances.

 

 

 

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

Post to forums  

Autodesk Design & Make Report