Is there a way to measure the minimum distance between a (Smart) solid and a bspline surface using the measure distance tool?Using "Flatten Direction" = none I get the result of a distance of 0.00mm when trying to measure minimum distance, having tried going from the bspline to the solid, and from the solid to the bspline
If I try to use any other flatten direction I get a message saying "Cannot measure distance between two elements"I can measure the distance to the blue line strings that are with the bspline, but only for the elevation of the line string Is there a restriction that makes you unable to measure minimum distance to bsplines? If so is there a way to work around this fact? I have tried using "Convert to Solid" tool on the bspline, but am unable to do so. Using the "Facet Curve" tool also does not seem to yield any results.
Hi Remy,
I can't think of any tool or snap mode at the moment, however, there is an example in the VBA help which demonstrates how this can be done (well close, its between a point and a surface, not solid to surface). It would be quite straight-forward to make a simple tool which would let you pick a point to measure from and then select the surface to compute the minimum distance point (or vice-versa), and return the value to a dialog or whatever. The example is called Compute the Projection of a Point onto a B-spline Surface
Barry,
Thanks for the info, I will look for this example and see what I can do with it.I do find it strange that such a thing would not be possible with the measuring tool designed for this purpose. But I guess that's just the way it is.
Barry,That is indeed what I'm looking for! I've also looked at the example in the docs you posted about, I'm assuming you used that as a base and extended on it?If I run the VBA example it creates a B-spline that also works with the built-in minimum distance tool, however at some point without changing the b-spline it stops working, saying the element is invalid. It feels like the standard minimum distance between tool is supposed to work with b-spline surfaces as well, but either requires very strict parameters or contains a bug.
Morning Remy
I used only a small part of the example and much more code is needed for selecting the surface and the point. The majority of the code in the example isn’t needed. I’m happy to upload my macro for you but I think it needs adjusted to suit whatever you want to do with the measured value. The message box isn’t really that useful; the distance could be copied to the clipboard and/or displayed in the original dialog. Let me know how you want the tool to perform. Also, how accurate should the result be (decimal places etc…)?
If you're willing to share your macro that'd be amazing! If the measured value could be shown in the original dialog box that'd be great, and the precision is good as it is.
Thanks a lot for your time and information.
Ok, I'm just updating it at the moment
Hi Remy, attached is the Macro.
I've updated the GUI so that there are now options where you can choose if you want to draw a line between the chosen point and the minimum distance point (setting disabled by default), and/or if you want to toggle measurement display between 2 decimal places (default setting) or max precision. It seems to be working without any issues for me but you can let me know if you run into any problems.
Use this key-in to run the macro:
VBA RUN [MeasureDistancePointToBspSurface]ModMain.Main
MeasureDistancePointToBspSurface.mvba
Answer Verified By: Remy Moerland