![]() Find the already created project and press Load. You must do it in the AutoCad drawing choosing Tools->LoadApplication. But each time you open a drawing you must load it. Visual Basic proposes you should save it with the name "Project", but it's up to you to choose any name (may be smth more associative like "3dTo2d") Well, follow these steps to to be able to use the VBA macro I sent to you:ġ.Open Autocad (no matter new drawing or not)Ģ.Tools->Makro->VisualBasicEditor - Visual Basic window is openedĤ.Copy the macro "Convert3To2DPolylinesWithElevation" from CadTutor window and Paste it in the newly created module (the blank area to the right in the VisualBasic window)ĥ.File->Save (browse for a place to save your new project ). MsgBox Cn & " 3dPolyline(s) converted to 2dPolyline(s)" If objEnt.ObjectName = "AcDb3dPolyline" Thenįor i = 1 To ((UBound(Coords) + 1) / 3) - 1 Set objSS = ThisDrawing.SelectionSets("MySS") After the transformation all the newly created objects are being highlighted.Old 3dPolylines are deleted. After running the macro you are promptrd to select all the 3dPolylines you want to be turned to 2dPolylines. (princ "\nCVPOLY.LSP Copyright 1997 Tony Tanzillo") (princ "\nCVPOLY command loaded.") (t (setvar "CMDECHO" 0) (command "._UNDO" "_Begin") (repeat (setq i (sslength ss)) (cvpoly (ssname ss (setq i (1- i)))) ) (command "._UNDO" "_En") ) ) (princ) ( (not (setq ss (ssget filter:3dpoly))) (princ "\nNo 3D Polylines selected.")) (mapvertex pline '(lambda (data) (if (zerop (logand (get 70 data) 9)) (assoc 70 data) (subst (cons 210 (setq ucs (ucszdir))) (assoc 210 data) (subst '(100. (setq data (entget pline '("*"))) (entmake (subst (cons 70 (logand (get 70 data) (~ )) (setq rslt (cons ( (lambda (function data / e d rslt) (apply function (list data)) ) function d ) rslt ) ) ) (reverse rslt) ) ( (lambda (p) (list (car p) (cadr p) 0.0) ) (trans wcspoint 0 1) ) (defun get (key alist) (cdr (assoc key alist)) ) Converts 3D polylines to 2D polylines that lie on CVPOLY.LSP Copyright 1996, 1997 Tony Tanzillo all rights reserved The 3D lines I have are a constant height (they are contours).ĭoes anyone know if its possible to amend the lisp below to retain the height data? Unfortunately it disgards the elevation/height data. I have a lisp programme which converts 3D polylines to 2D polylines.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |