Catia macro to change edited sketch

649 views Asked by At

I want to make some changes to an sketch in edition. So I have an sketch that is in edition, and I want to run a macro that detects which sketch is in edition and makes the desired changes.

How can I auto detect which sketch is in edition?

1

There are 1 answers

1
C R Johnson On BEST ANSWER

Partial answer: First look at the value of CATIA.GetWorkbenchId. If it returns "CSOWKS" then the sketch editor is active.

If the sketch is in a Part body, thePart.InWorkObject will return the sketch being edited.

However, if the sketch is in a Geometrical Set, it will not (It returns the geometrical set containing the sketch). I am not sure how you determine the sketch in that case.

In my experience if you find yourself editing sketches with VB there is probably a better way.