Welcome to the Onshape forum! Ask questions and join in the discussions about everything Onshape.

First time visiting? Here are some places to start:
  1. Looking for a certain topic? Check out the categories filter or use Search (upper right).
  2. Need support? Ask a question to our Community Support category.
  3. Please submit support tickets for bugs but you can request improvements in the Product Feedback category.
  4. Be respectful, on topic and if you see a problem, Flag it.

If you would like to contact our Community Manager personally, feel free to send a private message or an email.

Given a sketch object selection, how would i get a reference to the sketch that owns it?

dave_cowdendave_cowden Member, Developers Posts: 470 ✭✭✭
Suppose a user selects a sketch entity like so:

<div>&nbsp; &nbsp; &nbsp; &nbsp; annotation { "Name" : "Sketch Objects",</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "Filter" : (GeometryType.ARC || GeometryType.LINE) && SketchObject.YES,&nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "MaxNumberOfPicks" : 100 }</div><div>&nbsp; &nbsp; &nbsp; &nbsp; definition.sketchThings is Query;</div>
How would i go about getting a reference to the sketch object that contains it, so that i can add other items to the same sketch?

I know I can use evOwnerSketchPlane, but i want the sketch, not the plane.
I tried qOwnerBody() but that doesnt seem to produce a sketch object

Best Answer

Answers

  • dave_cowdendave_cowden Member, Developers Posts: 470 ✭✭✭
    hah! the old kill-your-own-grandfather problem!  If i had a nickle for every time i run into that ;)


Sign In or Register to comment.