View Full Version : Lines to 3d plines
scoutdog
25th Aug 2005, 02:01 pm
Is there a lisp routine that allows you to turn lines into 3d polylines? We have a file that had 3d polylines in it, but was exploded. Now we have a bunch of lines with two elevations. How can I turn these into 3d polylines again? We have SurveCAD 2006, Civil 3D, and Autodesk Land Desktop. Thanks
scj
25th Aug 2005, 03:33 pm
Try out my PEDIT3D from www.black-cad.de
It will consider fuzzy gaps and joines (circular and elliptical) arcs and splines to unique 3d-polylines too.
Good luck!
Jochen
fixo
26th Aug 2005, 10:27 am
Is there a lisp routine that allows you to turn lines into 3d polylines? We have a file that had 3d polylines in it, but was exploded. Now we have a bunch of lines with two elevations. How can I turn these into 3d polylines again? We have SurveCAD 2006, Civil 3D, and Autodesk Land Desktop. Thanks
Hi, scoutdog
Written on the fly but
maybe this helps to you
Thank you
Fatty
;; Convert objects: Lines->3dPolyline
;; Helper function to make points array
(defun safelist (lst)
(setq lst (apply 'append lst))
(vlax-safearray-fill
(vlax-make-safearray
vlax-vbDouble
(cons 0 (- (length lst) 1))
)
lst
)
)
; ;;
(defun C:L23p (/ 3pl acsp adoc ans axss end flag pt_list ret sfar ss st
ves)
(vl-load-com)
(or adoc
(setq adoc (vla-get-activedocument
(vlax-get-acad-object)
)
)
)
(or acsp
(setq acsp (vla-get-block
(vla-get-activelayout adoc)
)
)
)
(vla-endundomark adoc)
(vla-startundomark adoc)
(setq ves nil
ret nil
) ;->for debug only
(prompt "\n *** SELECT BUNCH OF LINES TO TURN INTO 3DPOLY ***")
(if (setq ss (ssget '((0 . "LINE"))))
(progn
(setq axss (vla-get-activeselectionset adoc))
(vlax-for ln axss
(setq st (vlax-curve-getstartpoint ln)
end (vlax-curve-getendpoint ln)
ves (cons st (cons end ves))
)
)
)
)
(while (car ves)
(setq pt_list (cons (nth 0 ves) pt_list)
ves (vl-remove (nth 0 ves) ves)
)
)
(initget "Yes No")
(setq ans (getkword "\n\rIt must be closed polyline? (Y/N)<N>"))
(if (not ans)
(setq ans "No")
)
(if (eq ans "Yes")
(progn
(setq pt_list (cons (car pt_list) pt_list))
(setq flag :vlax-true)
)
(progn pt_list
(setq flag nil)
)
)
(setq sfar (safelist pt_list))
(setq 3pl (vla-add3dpoly acsp sfar))
(if (and flag
(vlax-property-available-p 3pl 'Closed)
)
(vlax-put-property 3pl 'Closed flag)
)
(vla-update 3pl)
(vlax-release-object 3pl)
(vla-erase axss)
(vla-delete axss)
(vlax-release-object axss)
(vla-regen adoc acallviewports)
(vla-endundomark adoc)
(princ)
)
(prompt "\n\t *** Program loaded, type \"L23P\" to start. ***\t")
(C:L23p)
(princ)
Powered by vBulletin™ Version 4.1.2 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.