Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Sketch block visibility w/ilogic

3 REPLIES 3
SOLVED
Reply
Message 1 of 4
Anonymous
582 Views, 3 Replies

Sketch block visibility w/ilogic

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

3 REPLIES 3
Message 2 of 4
johnsonshiue
in reply to: Anonymous

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
Message 3 of 4
Sergio.D.Suárez
in reply to: Anonymous

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
in reply to: Sergio.D.Suárez

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

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

Post to forums  

Technology Administrators


Autodesk Design & Make Report