Hello,
is there a way to select and activate a sketch with iLogic? The best way would be to usw them in the rule with their names is this possible?
Like: There are three sketches
If x = 1 then
activate sketch_1 and do whatever
End If
If x = 2 then...
In addition I would like to know if it is possible to create a sketch with iLogic and make form like a rectangle in it?
Any Ideas or questions?
Thanks in advance
Solved! Go to Solution.
Solved by LukeDavenport. Go to Solution.
Hi MK92,
Paste the rule below into a part file, with a multi-value text parameter called TestParam, with values 'A', 'B', 'C', 'D'. Create 4 sketches in the part called Sketch1, Sketch2, Sketch3 and Sketch4. When you switch the value of that parameter it'll activate different sketches.
Does that help?
Luke
Dim oSketches As PlanarSketches = ThisApplication.ActiveEditDocument.ComponentDefinition.Sketches ' Exit active sketch if we are currently editing a sketch
If TypeOf ThisApplication.ActiveEditObject Is Sketch Then ' Set a reference to the active sketch.
Dim oSketch As Sketch = ThisApplication.ActiveEditObject oSketch.ExitEdit End If Select Case TestParam Case "A" oSketches("Sketch1").Edit Case "B" oSketches("Sketch2").Edit Case "C" oSketches("Sketch3").Edit Case "D" oSketches("Sketch4").Edit End Select
Works fine! Thank you very much.
But out of interest, i dont need it but would like that feature, is there a way to bring a form like a rectangle or a block in this sketch?