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.

Measuring the distance between objects

alex_bruskinalex_bruskin Member, Developers Posts: 2
Hi-

We just started experimenting with OnShape. Our principal experience is in CATIA and we are trying to find familiar features.

Presently, we can't find the OnShape intersect API

This is a good description on how it works in CAA:
1. go to C++ API, top right corner
2. scroll down to SpaceAnalysisInterfaces
3. click CATIMeasurableInContext
This gives a MinimumDistance calculation between two bodies or minimum distance between body and a point.

Thanks,
Alex

Answers

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

    Is there any reason you want to do this with the API?  If you just want to know the distance, you can select any two entities and measurement information will appear in the bottom right corner of the graphics area (clicking the little up arrow next to this will give additional information). If you would like to use distance information programmatically you can use the 'Measure Distance' Featurescript:

    https://cad.onshape.com/documents/572b968ce4b07aad125dbaaf/v/08093fef6c4d4f330f24dd19/e/b40df94c5081948fe8195e81

    This will allow you to measure the minimum or maximum distance between entities and store it in a variable to be used in later modeling operations.  If you would like to write a custom FeatureScript to do this you can use our 'evDistance' functionality by hand:

    https://cad.onshape.com/FsDoc/library.html#evDistance-Context-map

    If your workflow requires you to use the API, I'm sure someone besides me knows how to do that :)
    Jake Rosenfeld - Modeling Team
  • alex_bruskinalex_bruskin Member, Developers Posts: 2
    Hi Jake, this is very interesting. We absolutely need the ability to obtain the distances programmatically. We will look into the API you mentioned, hopefully it does what we need. Thanks a lot for the guidance. I will update the post once we test it...
Sign In or Register to comment.