Tips & tricks for AutoCAD / Bricscad / ZWCAD users

Automate mesh to solid conversion with AutoLISP

How to automate mesh to solid conversion with AutoLISP step by step tutorial.

  1. Reset CMDDIA system variable to disable command dialog boxes:
    (command "CMDDIA" 0)
  2. Execute mesh to solid command with the given command line parameters:
    (command "AMCONVERTMESH" (entlast) "" "Face" "None" "No" "No" "No")
  3. To import mesh file with AutoLISP automation script use the code below:
    (command "AMIMPORTMESH" "C:\\work\\mesh.obj" "polyfacemesh")
  4. To export 3D model to a mesh file format with AutoLISP command:
    (command "AMEXPORTMESH" (entlast) "" "C:\\work\\solid.skp")
  5. To enable dialog boxes for mesh to solid conversion command revert CMDDIA change:
    (command "CMDDIA" 1)