Author Topic: drap slection set of lines on selection set of 3dpolylines  (Read 1772 times)

0 Members and 1 Guest are viewing this topic.

motee-z

  • Newt
  • Posts: 40
drap slection set of lines on selection set of 3dpolylines
« on: August 27, 2015, 03:42:23 PM »
Hello
i need help to drape a selection set of lines on a selection set of 3d polylines as in attached drawing
any help will highly appriciated

motee-z

  • Newt
  • Posts: 40
Re: drap slection set of lines on selection set of 3dpolylines
« Reply #1 on: August 28, 2015, 04:08:26 PM »
still hoping someone who can help me

ymg

  • Guest
Re: drap slection set of lines on selection set of 3dpolylines
« Reply #2 on: September 03, 2015, 02:21:23 PM »
motee-z,

Use your blue lines as fences to select your polylines.

Each line will return a selection set, use ssnamex to get the
2d intersection points between lines and polylines.

Use these points to get the z value using the curves function.

ymg

ymg

  • Guest
Re: drap slection set of lines on selection set of 3dpolylines
« Reply #3 on: September 04, 2015, 12:04:31 PM »
Here is some code to get you started.

Beware that there is no error trapping.

Also the method to get the z using (osnap p "_appint")
is sensitive to zoom level.

Code - Auto/Visual Lisp: [Select]
  1. ;; Modified a routine by AlanJT                                               ;
  2. ;;                                                                            ;
  3. ;; Will entmake a 3d polyline given, 3d point list l                          ;
  4. ;;                                                                            ;
  5. ;; Returns ename of polyline                                                  ;
  6.  
  7. (defun mk_3dp (l / p)
  8.    (if (> (length l) 1)
  9.       (progn
  10.          (entmakex '((0 . "POLYLINE") (70 . 8)))
  11.          (foreach p l
  12.             (entmakex (list '(0 . "VERTEX") (cons 10 p) '(70 . 32)))
  13.          )
  14.          (entmakex '((0 . "SEQEND")))
  15.       )
  16.    )
  17.    (entlast)
  18. )
  19.  
  20.  
  21. ;;      Main Routine                                                          ;
  22.  
  23. (defun c:test (/ i j ent fen ss ss1 p pol lst itm int)
  24.  
  25.    (setq ss (ssget "_X" '((0 . "LINE")(8 . "LAY"))))
  26.  
  27.    (repeat (setq i (sslength ss))
  28.       (setq ent (entget (ssname ss (setq i (1- i))))
  29.             fen (list (cdr (assoc 10 ent)) (cdr (assoc 11 ent)))
  30.             ss1 (ssget "_F" fen '((0 . "POLYLINE")))
  31.             pol nil
  32.       )
  33.       (repeat (setq j (sslength ss1))
  34.          (setq lst (ssnamex ss1 (setq j (1- j))))
  35.          (foreach itm lst
  36.             (setq itm (cdddr itm))
  37.             (foreach int itm
  38.                (setq p (cadr int))
  39.                (vl-cmdf "_ZOOM" "_C" p "200X")
  40.                (setq pol (cons (osnap p "_appint") pol))
  41.                (vl-cmdf "_ZOOM" "_P")
  42.             )
  43.          )
  44.       )
  45.       (mk_3dp pol)
  46.    )
  47. )  
  48.  


ymg

motee-z

  • Newt
  • Posts: 40
Re: drap slection set of lines on selection set of 3dpolylines
« Reply #4 on: September 04, 2015, 02:01:54 PM »
 you are great ymg thank you  for your reply
it works fine

ymg

  • Guest
Re: drap slection set of lines on selection set of 3dpolylines
« Reply #5 on: September 04, 2015, 02:37:15 PM »
motte-z,

There might be some funny results when the blue lines
intersects with the newly created 3d poly.

ymg