AutoCAD Architecture Forum
Welcome to Autodesk’s AutoCAD Architecture Forums. Share your knowledge, ask questions, and explore popular AutoCAD Architecture topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Batch convert to mass elements

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
hanslammerts
540 Views, 2 Replies

Batch convert to mass elements

Hi, i'm digging into ACA and face a model with a lot of solids i want to turn into mass elements SEPERATELY

Found this old post with no answer yet. How is this done?

 

https://forums.autodesk.com/t5/autodesk-architectural-desktop/3d-solids-to-mass-elements-batch/td-p/...

2 REPLIES 2
Message 2 of 3
David_W_Koch
in reply to: hanslammerts

You would have to run the MassElementConvert command once for each Solid, if you need separate Mass Elements.

 

A relatively simple AutoLISP routine, that allows you to select the Solids, and then feeds each one to the MassElementConvert command could automate the process.  The following is a bare-bones routine that will do that.  It deletes the original Solids.

(defun C:S2ME ( / ename icount ss1)
  (setq ss1    (ssget '((0 . "3DSOLID")))
        icount 0
  ) ;_ End setq.
  (while (setq ename (ssname ss1 icount))
    (command "_.MassElementConvert" ename "" "_Y" "")
    (setq icount (1+ icount))
  ) ;_ End while.
  (prompt "\nSelected Solids converted to individual Mass Elements.  Solids deleted. ")
  (prin1)
) ;_ End C:S2ME.

If you want to keep the Solids, in the "command" line, change "_Y" to "_N" and in the "prompt" line, change deleted to retained.

 

If you are not familiar with loading AutoLISP files and using AutoLISP-defined commands, open a new instance of Notepad.  Copy the text above to the clipboard and paste it in Notepad.  Save the file with the name S2ME.lsp.  (You can call the file any legal Windows file name you want, but you must specify the .lsp extension; you do not want the default .txt file extension.)  Saving the file to a folder that is a trusted location in AutoCAD will make things a little easier, but is not absolutely necessary (particularly if you do not have write access to any of your trusted folders).

 

To load the file, you can drag and drop the file from File/Windows Explorer onto the AutoCAD drawing canvas, with the file in which you want to use the S2ME command open and current.  There are other ways to load the file; I find that to be easiest.  Depending upon your settings, and where you saved the file, you may get a dialog indicating that the file is not from a trusted location.  Choose to load the file.  You should then see something like this:

(LOAD "D:/ADT/LISP/S2ME.lsp") C:S2ME

at the command line.  In your case, you would see the path to the location where you saved the AutoLISP file in place of "D://ADT/LISP/. (If you gave the file a name other than S2ME.lsp, then your file name would appear instead of S2ME.lsp.)

 

With the file loaded, type S2ME at the command line, and press the ENTER key.  You will be asked to select objects.  You can select any objects you want, using whatever method you want (single picks, window, crossing window, fence, etc.), but only 3DSOLID objects will be included in the selection set.  When done selecting objects, press the ENTER key, and the program will do the rest.  You will see the text on the "prompt" line when the command is done.


David Koch
AutoCAD Architecture and Revit User
Blog | LinkedIn
EESignature

Message 3 of 3
hanslammerts
in reply to: David_W_Koch

Super, saves a lot of time!!!

Thanks David!

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost