Is there any way through autolisp to check the distance between a point and a solid?
Thanks!
Try it this way ....
(setq ss (vlax-ename->vla-object (car (entsel "\n Select Object :")))) (setq p (vlax-curve-getClosestpointto ss '(0. 0. 0.) T))
Tharwat
I get: errorbad argument value: AcDbCurve 43
When running and selecting a solid as the object......
Add the following code to the first of the previous codes .
(vl-load-com)
What kind of Solid entity you are trying to get a close point to it ?
I am sorry , the codes that I provided is not working with 3dsolid .
Could you please bring a dwg to sheck it out if it is possible .
Regards.
A brief way of getting a distance, or a surface point, is to use the point value of the return of the entsel function.
Here is a copy of the drawing. I tried the function on the solid, and the surfaces and it returns the same error.
It does work on the simple polyline shape however.
Or, you try, on your dwg, which I do not want here,
; dist to 3Dsolid edges
(defun c:pd ( / np p00 osm ) (graphscr) (redraw)
(setq osm (getvar "osmode") p00 '(0 0 0)) ; or use your coords, or get a point
(setvar "osmode" 545) ; end near int, or set yours, 1 end 32 int 512 nea
(setq np (getpoint p00 "\n Pick Oject Edge or Corner" ))
(if np
(progn
(setq nd (distance p00 np)) (grdraw p00 np 1)
(princ" Dist: ")(prin1 nd )))
(setvar "osmode" osm ) (princ) )
(c:pd)