CATIA V5 macro, how to get the current activate sketch
CATIA V5 macro, how to get the current activate sketch
(OP)
Before a macro program begin running, a sketch has be opened. My problem is that how can I get the name of the sketch, and its parent object? In many examples, we use sketch.add(),or a certain name of sketch. But in different situations the opened sketches may have different names.
Any one have faced such problem ?
Any one have faced such problem ?





RE: CATIA V5 macro, how to get the current activate sketch
--Doug
RE: CATIA V5 macro, how to get the current activate sketch
RE: CATIA V5 macro, how to get the current activate sketch
Regards
Fernando
https://picasaweb.google.com/102257836106335725208 - Romania
https://picasaweb.google.com/103462806772634246699... - EU
RE: CATIA V5 macro, how to get the current activate sketch
CODE --> code
Sub CATMain() CATIA.StartCommand ("No 3D Background") CATIA.StartCommand ("Fit All In") Set oSel = CATIA.ActiveDocument.Selection oSel.Search ("Sketcher.Origin,scr") Set oSketch = oSel.Item(1).Value.Parent.Parent.Parent oSel.Clear MsgBox ("the sketch is " & oSketch.Name) End SubI'm searching for the Origin so it should be quick, but it should be visible, if not, then search for element type you know is visible then get parent until you get sketch.
indocti discant et ament meminisse periti