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.

Get multiple vertices from a query

Kaiden_ShinewKaiden_Shinew Member Posts: 2

How would I go about getting multiple vertices from a query?

I have a parameter that creates a query of 3 points. I am attempting to make a plane using the 3 points.

Here is what I have so far:

annotation {"Name" : "Points", "Filter" : (EntityType.VERTEX), "MaxNumberOfPicks" : 3}
definition.points is Query;

var points = {};
        
for (var i, point in evaluateQuery(context, definition.points)) {
    points[i] = point;
}

var origin = (points[0] + points[1] + points[2])/3;
var normal = cross(points[0] - points[1], points[0] - points[2]);

opPlane(context, id + "plane1", {
    "plane" : plane(origin, normal)
}

When I print the `point` variable, I am hoping for a Vector, but I instead get this:

{ queryType : TRANSIENT , transientId : I2 }

Comments

  • NeilCookeNeilCooke Moderator, Onshape Employees Posts: 5,826

    You need to use evVertexPoint to get the coordinates for each vertex.

    Senior Director, Technical Services, EMEA
Sign In or Register to comment.