TheSwamp
Code Red => AutoLISP (Vanilla / Visual) => Topic started by: flopo on November 27, 2009, 02:33:36 AM
-
Hello everybody,
I'm working with 3d polylines and I need a lisp to do this: to draw lines from some points perpendiculat to a 3d polyline. There are a lot of points, 3d points - I mean points in space, with Z different from 0. From each point to draw a perpendicular on 3d polyline, but on that part of poly that is closer to my point. Is it possible? Thanks!
-
Does your polyline have multiple Vertex Points ?
Do you want the program to select the pline Segment as well as the point. ?
Can you provide a sample drawing for testing.?
-
This is an example, but not the best one. Is about a pipe, but in this case is flatten, z=o for all vertices.This is a 2d polyline.I don't have now an example with 3d polyline. Anyhow, the difference on Z axis is not big.
-
Perhap this?
(defun c:perp (/ i ss ent pt p1 p2)
(vl-load-com)
(princ "\n>> Select Points >>")
(if (setq i -1 ss (ssget '((0 . "POINT"))))
(if (and (setq ent (car (entsel "\nSelect Curve: ")))
(wcmatch (cdr (assoc 0 (entget ent))) "*LINE,CIRCLE,ELLIPSE,ARC"))
(while (setq pt (ssname ss (setq i (1+ i))))
(setq p2 (vlax-curve-getClosestPointto ent (setq p1 (cdr (assoc 10 (entget pt))))))
(entmake (list (cons 0 "LINE") (cons 10 p1) (cons 11 p2))))))
(princ))
-
And for those who want to follow this thread in it's entirety:
http://discussion.autodesk.com/forums/thread.jspa?threadID=753908&tstart=0
http://cadtutor.net/forum/showthread.php?t=42442
-
Thanks Lee Mack, is perfect!
-
Hello everybody,
after drawing perpendicular lines from points to a 3dpoly, I have to measure the distance between consecutive intersection 3dpoly - perpendicular line. A lisp to do this will help me a lot... See the attachment - drawing. Thanks!
-
Hello
I can help u if still needed !!!
Waiting for u
Amir