0

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?

Jason Aller
  • 3,541
  • 28
  • 38
  • 38

1 Answers1

1

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.

C R Johnson
  • 964
  • 1
  • 5
  • 12
  • That' real interesting, but i'm having a problem in thePart.InWorkObject. it returns an error. Meanwhile, surfacing across the internet, I found this: http://www.eng-tips.com/viewthread.cfm?qid=415451 – Tiago Figueiredo Jan 11 '17 at 08:15