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.
Measure Distance Custom feature, how to see the result?
owen_sparks
Member, Developers Posts: 2,660 PRO
Hi guys. I think I'm being daft...
Just been playing with the new featurescript "Measure Distance" tool.
This does what it says and then puts the result in a variable. All good so far, but how do I see the current value of the variable?
I know the value is being loaded into the variable as I can use the variable to define a sketch entity dimension and then use the dimension tool to display the result. So it works fine, but how can I see the result?
Cheers,
Owen S
Just been playing with the new featurescript "Measure Distance" tool.
This does what it says and then puts the result in a variable. All good so far, but how do I see the current value of the variable?
I know the value is being loaded into the variable as I can use the variable to define a sketch entity dimension and then use the dimension tool to display the result. So it works fine, but how can I see the result?
Cheers,
Owen S
Business Systems and Configuration Controller
HWM-Water Ltd
HWM-Water Ltd
Tagged:
0
Best Answers
-
ilya_baran Onshape Employees, Developers, HDM Posts: 1,211In the future, we'd like to make it easier to inspect variable values.
Today, a "hacky" solution is to make another variable after "Measure Distance" and assign the measure distance result to the new variable, which will cause the value to be shown in the feature list. Alternatively, you can copy the "Measure Distance" source code and add a println(distanceResult.distance); before the setVariable call -- then the value will appear in the FeatureScript console (but in meters).Ilya Baran \ VP, Architecture and FeatureScript \ Onshape Inc5 -
kevin_o_toole_1 Onshape Employees, Developers, HDM Posts: 565Good point.
Here's a copy of the measure distance feature that puts the measured distance as part of the feature name:
https://cad.onshape.com/documents/576bf68ee4b0e983870b4e6a/v/e3531e961c54cf241a4c8536/e/fc4c7df535b51f797d6951ae
5
Answers
Today, a "hacky" solution is to make another variable after "Measure Distance" and assign the measure distance result to the new variable, which will cause the value to be shown in the feature list. Alternatively, you can copy the "Measure Distance" source code and add a println(distanceResult.distance); before the setVariable call -- then the value will appear in the FeatureScript console (but in meters).
Also I'd like to say thanks for your 3D spline tool. That has allowed me to start modeling cables and is a great addition to the tool set.
Regards,
Owen S.
HWM-Water Ltd
Here's a copy of the measure distance feature that puts the measured distance as part of the feature name:
https://cad.onshape.com/documents/576bf68ee4b0e983870b4e6a/v/e3531e961c54cf241a4c8536/e/fc4c7df535b51f797d6951ae
I'm beginning to think this Onshape thingymabob might be quite good...
Thanks guys couldn't ask for more.
Cheers,
Owen S.
HWM-Water Ltd