sketch visibility in part bij ilogic

sketch visibility in part bij ilogic

Anonymous
Not applicable
744 Views
3 Replies
Message 1 of 4

sketch visibility in part bij ilogic

Anonymous
Not applicable

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.

Accepted solutions (1)
745 Views
3 Replies
Replies (3)
Message 2 of 4

rossano_praderi
Collaborator
Collaborator
Accepted solution

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

Anonymous
Not applicable
Hi Bregs
Thanks for the solution, this works for me.
0 Likes
Message 4 of 4

rossano_praderi
Collaborator
Collaborator
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!
---------------
0 Likes