Jump to content

Need to export each solid as separate dwg, dxf or 3ds file format


Recommended Posts

Posted (edited)
11 hours ago, ADSK2007 said:

marko_ribar

 

Amazing :) Thank you marko. How do I save as 3ds format?

` ;  `  replace the sign   

 

 

;ss (ssget "_X" '((0 . "*POLYLINE") (-4 . "&=") (70 . 8)))         ; polyline object
          ss (ssget "_X" '((0 . "*SOLID") ))                                ; solid 

Edited by thecocuk07
Posted (edited)

 

.

Edited by thecocuk07
Posted (edited)
4 hours ago, thecocuk07 said:

hi marko  , 

 

It records only one object from every layer

 

exp ;  layer ,      charlie  , andy , brady      ,,,,,,,, 10 object have  

 

charlie000

charlie001

charlie002.....

 

andy000

andy001

andy002....

 

 

 

(defun c:WBP ( / c_doc o_arr ss o_lst cnt fname)
    (setq c_doc (vla-get-activedocument (vlax-get-acad-object))
          o_arr (vlax-make-safearray vlax-vbobject '(0 . 0))
          ss (ssget "_X" '((0 . "*SOLID") ))
    );end_setq

    (repeat (setq cnt (sslength ss))
      (setq o_lst (cons (vlax-ename->vla-object (ssname ss (setq cnt (1- cnt)))) o_lst))
    );end_repeat
    
    (setq cnt 0)
    
    (foreach obj o_lst
      (setq sso (vla-add (vla-get-selectionsets c_doc) "PLO")
            fname (strcat (getvar 'dwgprefix) (cdr (assoc 8 (entget (vlax-vla-object->ename obj)))) (itoa cnt) ".dwg")
      );end_setq
      (vlax-safearray-put-element o_arr 0 obj)
      (vla-additems sso o_arr)
      (vla-wblock c_doc fname sso)
      (vla-delete sso)
      (setq cnt (1+ cnt))
    );end_foreach  
);end_defun

charlie0

charlie1

charlie2.....

 

andy3

andy4

andy5

Edited by thecocuk07
Posted (edited)

.

 

 

Edited by thecocuk07
  • 3 years later...
Posted

When you WBLOCK each solid, leave it at its real world coordinates and use a common base point of 0,0,0 for every file. If you move each solid to the origin before export, DIALux has no relative position left to rebuild the room. Keep the same units in AutoCAD and DIALux (metres is safest); a units mismatch is the usual reason imports appear in the wrong place even when the base point is consistent. Because you already have each solid on its own layer, naming the WBLOCK after the layer is fine. Prefer DWG over 3DS if evo will accept it, and lower FACETRES if the mesh is too heavy. After import, check one known corner against the original coordinates before you assign materials.

Posted
On 1/23/2023 at 12:48 AM, ADSK2007 said:

Hello everyone

I need to export every solid object inside a cad file into a dwg, dxf or a 3ds file format. The export process can use any name, (ex. Solid-001, Solid-002, etc.).
one important thing to mention is that the solid needs to be saved based on 0,0,0 location.

 

1- Is there a procedure Inside AutoCAD I can take to do this? File save as or Export?

AutoCADtutorials

 

2- Could this be done using a script?

3- Are there any lisp that can accomplish such task?

4- Can this be done with a 3rd party plug-in or application other than AutoCAD?

 

Any suggestion would be very helpful and greatly appreciated

The file has too many objects to export individually so I am looking for an alternative solution to do this automatically.

 

Thank you

This can be automated using AutoLISP with the WBLOCK command. A routine can iterate through all 3DSOLID entities, export each one as a separate DWG, and generate sequential filenames such as Solid-001.dwg. One important detail is to distinguish between preserving the original world coordinates and moving each solid to 0,0,0. Which output do you need: original coordinates or each solid individually positioned at the origin?

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...