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.

error on set attribute

papawopapawo Member, Developers Posts: 206 PRO
edited May 2018 in FeatureScript
i have query 1(featurelist) and query 2 (face);
if i choose query1, set attribute "entities" : entity,;
if i choose query2, set attribute"entities" : entity,

why do i get error when i choose query2? error is "@setAttribute: CANNOT_RESOLVE_ENTITIES"

Best Answer

Answers

  • papawopapawo Member, Developers Posts: 206 PRO
    i found out that if the other query is nothing , it gives me error.
    so how should i do it then? user need to choose either of the 2 query.

  • papawopapawo Member, Developers Posts: 206 PRO
    solve it...i put else in the code...
  • papawopapawo Member, Developers Posts: 206 PRO
    im  getting an error..when i tried to use the last code.

  • papawopapawo Member, Developers Posts: 206 PRO
    im still getting error
    precondition of setattribute failed (definition entities is query)
  • Jake_RosenfeldJake_Rosenfeld Moderator, Onshape Employees, Developers Posts: 1,646
    In the code you sent me, if `definition.userSelFaces` is false, the "entities" variable is never set, so you are passing undefined into `setAttribute`.

    In cases like this, using `println` to print out the values of certain variables at certain points in your code can be a very useful debugging technique.
    Jake Rosenfeld - Modeling Team
Sign In or Register to comment.