Tiago Figueiredo
Tiago Figueiredo

Reputation: 15

Catia macro to change edited sketch

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?

Upvotes: 0

Views: 751

Answers (1)

C R Johnson
C R Johnson

Reputation: 1101

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.

Upvotes: 1

Related Questions