Jump to content

Recommended Posts

Posted

Hello guys,

I'd like to ask you, if there is a lisp routine, where you can create lines between two polylines, that have the same number of points - every of which point/vertex is perpendicular with the one below or on top of it. It would be awesome because i have so many cross sections, where i have to do this, between every point that your head will hurt :cry:

 

Thank you guys in advance!

 

here's an example of what i need:

example_.dwg

Posted

Perhaps:

 

(defun c:VLines (/ line ent1 ent2 i p1 p2)
 (vl-load-com) ;; Lee Mac  ~  01.02.10

 (defun line (p1 p2)
   (entmake (list (cons 0 "LINE") (cons 10 p1) (cons 11 p2)))) 

 (while
   (progn
     (setq ent1 (car (entsel "\nSelect First Polyline: ")))

     (cond (  (eq 'ENAME (type ent1))

              (if (wcmatch (cdr (assoc 0 (entget ent1))) "*POLYLINE")
                (while
                  (progn
                    (setq ent2 (car (entsel "\nSelect Second Polyline: ")))

                    (cond (  (eq 'ENAME (type ent2))

                             (if (wcmatch (cdr (assoc 0 (entget ent2))) "*POLYLINE")
                               (progn
                                 (setq i (1- (vlax-curve-getStartParam ent1)))

                                 (while
                                   (and
                                     (<=
                                       (progn
                                         (setq p1 (vlax-curve-getPointatParam ent1 (setq i (1+ i)))) i)
                                       (vlax-curve-getEndParam ent1))
                                     (setq p2 (vlax-curve-getPointatParam ent2 i))) (line p1 p2)))

                               (princ "\n** Invalid Object **"))))))
                
                (princ "\n** Invalid Object **"))))))
 (princ))
                               
                                 

Posted

Thank you! It worked like a charm, you saved my ass :)

Posted
Thank you! It worked like a charm, you saved my ass :)

 

You're welcome :)

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...