- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I have a 3d model exported from Revit for a very complicated building im soon to be doing layout and quality checks for. I've been able to successfully break these down into poly and 3d poly lines in the past. However when I exploded this particular model it turns into polyface mesh and further explodes into 3d faces. I found a lisp routine code that is supposed to be able to automatically break this all down frm polyface mesh into poly and 3d poly lines. However I have next to no experience with Lisp routines. I found another Lisp that does something similar to the one Im asking about thats already in an Autolisp Application file and was able to easily load that all on with the guidance from these forums. While it works to a degree its still not quite doing what I need it to do. Id like to try this source code I found but have no idea how to make this into an easily loadable app file. Any help or guidance would be appreciated. Also if you have any good Lisp Applications for a construction surveyor I'd love to see if they could stream line my Civil 3d time. Here is the code I found and would like to convert. Im using 2024 Civil 3d if that makes any difference.
(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)
)
Solved! Go to Solution.
