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.

How do I get the BOTH ends of a user-created sketch line segment?

dave_cowdendave_cowden Member, Developers Posts: 470 ✭✭✭
Suppose the user has created a sketch, and on that sketch has created a line segment. Further, assume I have this as an input to my feature :

        annotation { "Name" : "UserLine","Filter" : GeometryType.LINE,"MaxNumberOfPicks" : 1 }
        definition.userLine is Query;

Now, i'd like to access that linesegment from within featureScript.  I can't figure out how to do it.

I can get the sketch Plane on which the line resides:

var sketchPlane = evOwnerSketchPlane ( context, { entity: definition.userLine } ); 

..And I can get the line definition using evLine:

        var line = evLine(context, {
                "edge" : definition.userLine
        });

But this line definition only gives me the starting point of the line segment the user created, not the ending. But i need to get the beginning and ending of the user's line segment. How can I do that?

I have tried toString() to see if I can access properties of the object I get as a result of evaluateQuery, but that doesn't help me.

There do not appear to be any examples in std of getting a sketch entity this way.

Best Answer

Answers

  • dave_cowdendave_cowden Member, Developers Posts: 470 ✭✭✭
    Oh yes of course, evEdgeTangentLines, did not think of that one!
    Thanks for the fast answer!
Sign In or Register to comment.