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 visibility in part bij ilogic

3 REPLIES 3
SOLVED
Reply
Message 1 of 4
j.vanderheijden
610 Views, 3 Replies

sketch visibility in part bij ilogic

I have a part with four sketches in it.
I also have a multi text parameter with four letters.
If parameter "A" is active I want to make sketch1 visible.
If parameter "B" is active I want to make sketch2 visible etc.
I have downloaded several codes but not work as I want.
Can someone help me get started.

Mvg Jos

Your drawings are only as good as the symbols that complete them...
3 REPLIES 3
Message 2 of 4

Hi Jos,

this is my example as your solution.

 

Dim sketches As PlanarSketches = ThisApplication.ActiveDocument.ComponentDefinition.sketches
Dim oSketch As PlanarSketch

For Each oSketch In sketches
	Select Case oSketch.Name
		Case "Sketch1"
			If TestParam = "A" Then
				oSketch.Visible = True
			Else
				oSketch.Visible = False
			End If
		Case "Sketch2"
					If TestParam = "B" Then
				oSketch.Visible = True
			Else
				oSketch.Visible = False
			End If
		Case "Sketch3"
					If TestParam = "C" Then
				oSketch.Visible = True
			Else
				oSketch.Visible = False
			End If
		Case "Sketch4"
					If TestParam = "D" Then
				oSketch.Visible = True
			Else
				oSketch.Visible = False
			End If
	End Select
Next

 

Bregs

Rossano Praderi



--------------------------------------
If my post answers your question, please click the "Accept as Solution"
button. This helps everyone find answers more quickly!
---------------
Message 3 of 4

Hi Bregs
Thanks for the solution, this works for me.
Mvg Jos

Your drawings are only as good as the symbols that complete them...
Message 4 of 4

Hi Mvg, Bregs isn't my name.

Anyway, is nice to be helpful.


--------------------------------------
If my post answers your question, please click the "Accept as Solution"
button. This helps everyone find answers more quickly!
---------------

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

Post to forums  

Autodesk Design & Make Report