Welcome to the Onshape forum! Ask questions and join in the discussions about everything Onshape.
First time visiting? Here are some places to start:- Looking for a certain topic? Check out the categories filter or use Search (upper right).
- Need support? Ask a question to our Community Support category.
- Please submit support tickets for bugs but you can request improvements in the Product Feedback category.
- 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_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.
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.
0
Answers
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
I hope that makes a little more sense of my question.
Regards
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.