Author Topic: OFFSET polylign 3D  (Read 1145 times)

0 Members and 1 Guest are viewing this topic.

clotho

  • Guest
OFFSET polylign 3D
« on: June 28, 2016, 07:21:32 AM »
Hi every body,

Please can any one give me a lisp to offset a 3D polylign.

Thank you in advance  :smitten:

ChrisCarlson

  • Guest
Re: OFFSET polylign 3D
« Reply #1 on: June 28, 2016, 07:56:58 AM »

rkmcswain

  • Swamp Rat
  • Posts: 978

MSTG007

  • Gator
  • Posts: 2606
  • I can't remeber what I already asked! I need help!
Civil3D 2020

ribarm

  • Gator
  • Posts: 3304
  • Marko Ribar, architect
Re: OFFSET polylign 3D
« Reply #4 on: June 28, 2016, 10:33:28 PM »
If nothing from above posted doesn't suit you, I'd convert 3d polyline to 3d spline and apply something from here :
https://www.theswamp.org/index.php?topic=51111.msg563254#msg563254

To convert 3d polyline to 3d spline, try something like this :

Code - Auto/Visual Lisp: [Select]
  1. (defun c:3p2spl ( / *error* line2spl loop pl e s ss sss )
  2.  
  3.  
  4.   (defun *error* ( msg )
  5.     (if msg (prompt msg))
  6.     (princ)
  7.   )
  8.  
  9.   (defun line2spl ( e / sp ep d )
  10.    
  11.     (setq sp (cdr (assoc 10 (entget e)))
  12.           ep (cdr (assoc 11 (entget e)))
  13.           d (distance sp ep)
  14.     )
  15.    
  16.     (entdel e)
  17.    
  18.     (entmakex
  19.       (list
  20.         '(0 . "SPLINE") '(100 . "AcDbEntity") '(100 . "AcDbSpline") '(210 0.0 0.0 1.0) '(71 . 1) '(73 . 2)
  21.         '(42 . 1.0e-010) '(43 . 1.0e-010) '(40 . 0.0) '(40 . 0.0) (cons 40 d) (cons 40 d) (cons 10 sp) (cons 10 ep)
  22.       )
  23.     )
  24.    
  25.   )
  26.  
  27.   (setq loop T)
  28.   (setq sss (ssget "_I"))
  29.   (if (and sss (eq (cdr (assoc 0 (entget (setq pl (ssname sss 0))))) "POLYLINE") (< 7 (cdr (assoc 70 (entget pl))) 10)) (setq loop nil))
  30.   (while loop
  31.     (setq pl (car (entsel "\nPick 3DPOLYLINE to convert it to SPLINE")))
  32.     (if (and pl (eq (cdr (assoc 0 (entget pl))) "POLYLINE") (< 7 (cdr (assoc 70 (entget pl))) 10)) (setq loop nil))
  33.   )
  34.   (setq e (entlast))
  35.   (command "_.EXPLODE" pl)
  36.   (while (> (getvar 'cmdactive) 0) (command ""))
  37.   (setq ss (ssadd))
  38.   (while (setq e (entnext e))
  39.     (if (eq (cdr (assoc 0 (entget e))) "LINE")
  40.       (progn
  41.         (setq s (line2spl e))
  42.         (ssadd s ss)
  43.       )
  44.     )
  45.   )
  46.   (command "_.JOIN" (ssname ss 0) ss)
  47.   (while (> (getvar 'cmdactive) 0) (command ""))
  48.   (*error* nil)
  49. )
  50.  

HTH, M.R.
Marko Ribar, d.i.a. (graduated engineer of architecture)

:)

M.R. on Youtube