Sketch visibility, in assembly, controlled by ilogic

Sketch visibility, in assembly, controlled by ilogic

Anonymous
Not applicable
891 Views
4 Replies
Message 1 of 5

Sketch visibility, in assembly, controlled by ilogic

Anonymous
Not applicable

Hi,

 

Being in Assembly environment, I would like to control the visibility of a specific sketch of a placed part using ilogic, but having problems to find the exact code necessary for such a function, can anyone help me with that?

0 Likes
892 Views
4 Replies
Replies (4)
Message 2 of 5

mcgyvr
Consultant
Consultant

Name of part? (its an ipt in the iam right and not an ipt in a subassembly iam correct?)

Name of sketch in that part?

 

 

 



-------------------------------------------------------------------------------------------
Inventor 2023 - Dell Precision 5570

Did you find this reply helpful ? If so please use the Accept Solution button below.
Maybe buy me a beer through Venmo @mcgyvr1269
0 Likes
Message 3 of 5

Mark.Lancaster
Consultant
Consultant

@Anonymous

 

I'm probably not seeing your "big picture" here...  Smiley Very Happy   But why spend time creating an iLogic program when you can already do that with View Reps...  Anyhow my 2 cents..

 

1,  Create a view rep at the part level with that sketch turned out.

2.  Then create a view rep at the assembly level and then right mouse click on that part in the assembly browser pane and select Representation.

3.  Select the Part View Rep that you want and click to associate it back to part view rep.

Mark Lancaster


  &  Autodesk Services MarketPlace Provider


Autodesk Inventor Certified Professional & not an Autodesk Employee


Likes is much appreciated if the information I have shared is helpful to you and/or others


Did this resolve your issue? Please accept it "As a Solution" so others may benefit from it.

0 Likes
Message 4 of 5

Anonymous
Not applicable

Yes, it's a .ipt in direct placed into the .iam.

 

Name of part: Floor

Name of sketch: Campus

 

Basically what i want is that the visibility should be controlled by a Boolean type of parameter, called "Campus", such as:

 

 SyntaxEditor Code Snippet

If Campus = True Then
Sketch.Visible("Floor", "Campus") = True
'Else'Sketch.Visible("Floor", "Campus") = False
End If

 

0 Likes
Message 5 of 5

Z0methink
Enthusiast
Enthusiast
Dim compOcc = Component.InventorComponent("Floor")
Dim oSk As PlanarSketch = compOcc.Definition.Sketches.Item("Campus")
Dim oSkProx As PlanarSketchProxy = Nothing
Call compOcc.CreateGeometryProxy(oSk, oSkProx)
oSkProx.Visible = Campus