I am trying to write an ilogic rule to control the visibilty of "sketch blocks" in a sketch. I know how to control visiblilty of a component:
Component.IsActive("Part1:1")= false
I would like to do something similar but only for a "sketch block".
Solved! Go to Solution.
Solved by Sergio.D.Suárez. Go to Solution.
Hi! I could be wrong but I don't believe there is an iLogic call to do that. You will need to use VB.Net code in an iLogic rule. Below is the help page for SketchBlock object.
http://help.autodesk.com/view/INVNTOR/2020/ENU/?guid=GUID-5595A5C2-8B27-4CEE-9968-E0C60160645C
Regarding IsActive() = True, it is actually not the same as making an object invisible. It first sets the occurrence BOM Structure to Normal/Reference and then Unsuppress/Suppress it.
Many thanks!
Hi, try this code in your file. You must specify for both items, where your block is located, and what is the number of your block.
Dim oDoc As Document = ThisDoc.Document Dim oCD As ComponentDefinition = oDoc.ComponentDefinition 'Acces to PlanarSketch Dim osketch As PlanarSketch =oCD.Sketches.Item(1)'Select sketch from numeric Item 'Acces to SketchBlock Dim oSketchBlock As SketchBlock = osketch.SketchBlocks.Item(1) 'Select sketchBlock from numeric Item oSketchBlock.Visible = False
I hope this helps
Sergio Daniel Suarez
Mechanical Designer
| Upwork Profile | LinkedIn
Can't find what you're looking for? Ask the community or share your knowledge.