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.

Where is Featurescript Environment/Reference System Documented?

peter_morrispeter_morris Member Posts: 43 ✭✭
I may have completely missed something, but I cant seem to find a description of the Featurescript environment.  By this I don't mean the programming environment is documented; I mean the drawing space - what are the basic parameters, what are each element of a Vector referring to for example, if I identify and edge i can return the adjacent vertices, but how can I get only 1 of the 2? How do I know the position of that vertex.

I'm sure these are simple ideas and concepts and they are probably simply common sense to those experienced in 3D CAD/Featurescript, but I'm just starting out and while I'm slowly fathoming it out through trial and error it would be so much simpler if there was a short tutorial or documented description.

If I've missed it please tell me where to look.

Many thanks for a great programme.


Best Answers

Answers

  • Jake_RosenfeldJake_Rosenfeld Moderator, Onshape Employees, Developers Posts: 1,646
    Hi Peter,

    Have you looked through https://cad.onshape.com/FsDoc/ ? It sounds like you have the basics down, but maybe skimming through the FeatureScript tutorials could help.  Additionally the Standard Library documentation can be very helpful once you get a better grasp of the language.  The 'Language Reference' and 'FeatureScript Guide' sections on the sidebar are also very helpful.

    As a more specific answer to your question, FeatureScript references geometry in terms of 'Query's.  If you end up with a Query that refers to two vertices, you could do 'var oneVertex = qNthElement(twoVerticesQuery, 0)' to get the first vertex.  To find the location of that vertex you can use 'var location = evVertexPoint(context, {"vertex" : oneVertex} )'.  location will then be a vector where the 0, 1, and 2 indices refer to the x, y, and z coordinates respectively.

    https://cad.onshape.com/FsDoc/library.html#qNthElement-Query-number
    https://cad.onshape.com/FsDoc/library.html#evVertexPoint-Context-map
    Jake Rosenfeld - Modeling Team
  • peter_morrispeter_morris Member Posts: 43 ✭✭
    Hi Jake, many thanks for the prompt reply.  I have been working through the documentation in some detail.  What I think I'm lacking is an understanding of the framework in which Onshape operates.  I think I have the idea of sketches leading to features, but perhaps its the more fundamental foundations that i'm missing - its highly likely its so simple it doesnt seem worth explaining.  I understand the concept of queries and, I think, evaluation, but what is lacking is a description of the space in which they operate.  For example, how do x, y and z, coordinates relate to the planes Top, Front and Right; perhaps: x & y axis bound the Top Plane, with positive Z as the 'up' normal, what direction is rotation measured, how do dimensions relate to positions.

    I hope that makes a little more sense of my question.

    Regards
  • NeilCookeNeilCooke Moderator, Onshape Employees Posts: 5,688
    XYZ relate to the coordinate system in the top right corner of the graphics area. 
    Senior Director, Technical Services, EMEAI
  • peter_morrispeter_morris Member Posts: 43 ✭✭

    Hi Iana,

    Many thanks.  Can you say which direction is a positive rotation?  Traditionally Clockwise would be a negative change in angle - so would be good to know how Onshape treats it.

  • peter_morrispeter_morris Member Posts: 43 ✭✭
    Many thanks - the prompt response is much appreciated.
Sign In or Register to comment.