Anyone that can verify this lisp routine and if it works?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I need to convert an exported Revit model into poly and 3d poly lines that I can put into a survey data collector and be able to layout in the field. I've tried another Lisp that didn't quite do what I needed and would like to try this one. I've put this into a text file saved it as ANSI and then renamed the file extension into .LSP. I've gotten it to load into Civil 3d 2024 but when I go to use it the command comes up but then doesn't do anything to the polyface meshes. Can someone please back check this? This is a 300 million dollar structure with over 2000 pages of drawings. It will take me the next year to fully model (I have a few weeks tops before I go on site) this out for use with a survey instrument.
(defun c:XplPgMesh
(/ oApp oDoc oMSp oObj vXplObj aXplObj oObjLst oObj2 vCoords o3dPline)
(VL-LOAD-COM)
(setq oApp (vlax-get-acad-object)
oDoc (vla-get-activedocument oApp)
oMSp (vla-get-modelspace oDoc)
) ;setq
(vlax-for oObj oMsp
(if (= (vla-get-objectname oObj) "AcDbPolygonMesh")
(if (setq vXplObj (vla-explode oObj))
(progn
(setq aXplObj (vlax-variant-value vXplObj))
(if (not (minusp (vlax-safearray-get-u-bound aXplObj 1)))
(progn
(setq oObjLst (vlax-safearray->list aXplObj))
(foreach oObj2 oObjLst
(if (= (vla-get-objectname oObj2) "AcDbFace")
(progn
(setq vCoords (vla-get-coordinates oObj2)
o3dPline (vla-Add3DPoly oMSp vCoords)
) ;setq
(vlax-put-property o3dPline 'Closed :vlax-true)
(vla-delete oObj2)
(vlax-release-object o3dPline)
) ;progn
) ;if
) ;foreach
(foreach itm oObjLst (vlax-release-object itm))
) ;progn
) ;if
(vla-delete oObj)
) ;progn
) ;if
) ;if
) ;vlax-for
(princ)
)