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.
Query a line to use for value
Dylan_Stewart
Member, Developers Posts: 107 PRO
I would like to be able to select a line and use the line's length to drive a variable all while being able to detect if there is a 90 degree corner or T and CROSS intersections.
What I am trying to accomplish is to be able to use a flat pattern and select either points or lines and produce models based on the location and length of the lines.
A bonus would be to import pre-modeled content that is variable driven.
What I am trying to accomplish is to be able to use a flat pattern and select either points or lines and produce models based on the location and length of the lines.
A bonus would be to import pre-modeled content that is variable driven.
Digital Engineering
0
Comments
-
You'd have to use evLine or evCurveDefinition to get the infinite line, evLength to get the length or evEdgeTangentLines (or evVertexPoint with a qVertexAdjacent) to get the endpoints. For the bonus, you will have to wait, but that is planned.
Please post if you need more details on the methods.Ilya Baran \ VP, Architecture and FeatureScript \ Onshape Inc0 -
@ilya_baran I will try and get a document set up to share to demonstrate. The bonus isn't a necessity as long as I can use the selected line/s to drive a length variable.
Sorry for the poor document, but I am still trying to wrap my head around how to tackle this.
https://cad.onshape.com/documents/62f8190e60737f0e6b7a5bca/w/3567400cd5af5ef1b443a595/e/ccf4a4c9a7e2ffc54950cb89
Digital Engineering0 -
Once you have a length, you can call setVariable to attach it to a context variable for subsequent features to use. If you just need a local variable,
var myLength = evLength(...);
will do that.Ilya Baran \ VP, Architecture and FeatureScript \ Onshape Inc0 -
Is there an example out there? I have no experience with setVariable.Digital Engineering0
-
Our standard variable feature provides one example: https://cad.onshape.com/documents/12312312345abcabcabcdeff/v/c2ddcb776af029dab0a34970/e/357eadcd05424ef4a2360e88
The measure distance custom feature provides another: https://cad.onshape.com/documents/572b968ce4b07aad125dbaaf/v/08093fef6c4d4f330f24dd19/e/b1f5ab07bb8056d230959ebeIlya Baran \ VP, Architecture and FeatureScript \ Onshape Inc1

