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!
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!
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.
Here ya go.
This will turn off any sketch named Sketch_TC in any part or sub assy that exists in your main assy.
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.
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.
Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register
Start with some of our most frequented solutions to get help installing your software.