Sketch block visibility w/ilogic

Sketch block visibility w/ilogic

Anonymous
Not applicable
673 Views
3 Replies
Message 1 of 4

Sketch block visibility w/ilogic

Anonymous
Not applicable

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". 

0 Likes
Accepted solutions (1)
674 Views
3 Replies
Replies (3)
Message 2 of 4

johnsonshiue
Community Manager
Community Manager

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!



Johnson Shiue (johnson.shiue@autodesk.com)
Software Test Engineer
0 Likes
Message 3 of 4

Sergio.D.Suárez
Mentor
Mentor
Accepted solution

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


Please accept as solution and give likes if applicable.

I am attaching my Upwork profile for specific queries.

Sergio Daniel Suarez
Mechanical Designer

| Upwork Profile | LinkedIn

Message 4 of 4

Anonymous
Not applicable

Thanks for the help, will give this a try when I get back.

0 Likes