Author Topic: 3d polyline lisp  (Read 8556 times)

0 Members and 1 Guest are viewing this topic.

flopo

  • Guest
3d polyline lisp
« 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!

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: 3d polyline lisp
« Reply #1 on: November 27, 2009, 04:32:49 AM »

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.?
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

flopo

  • Guest
Re: 3d polyline lisp
« Reply #2 on: November 27, 2009, 04:56:08 AM »
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.

Lee Mac

  • Seagull
  • Posts: 12914
  • London, England
Re: 3d polyline lisp
« Reply #3 on: November 27, 2009, 10:50:12 AM »
Perhap this?

Code: [Select]
(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))


CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: 3d polyline lisp
« Reply #4 on: November 27, 2009, 09:22:06 PM »
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

flopo

  • Guest
Re: 3d polyline lisp
« Reply #5 on: November 30, 2009, 02:12:25 AM »

Thanks Lee Mack, is perfect!
    

flopo

  • Guest
Re: 3d polyline lisp
« Reply #6 on: November 30, 2009, 02:34:14 AM »
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!

ahsattarian

  • Newt
  • Posts: 112
Re: 3d polyline lisp
« Reply #7 on: October 02, 2016, 08:28:34 AM »
Hello
I can help u if still needed !!!
Waiting for u
Amir