Jump to content

Convert Group to Block


Recommended Posts

Hi,

 

After exported Inventor file to 2D DWG, my dwg file is full of groups (corresponding of each element in inventor)

 

But my client don't want groups. He wants blocks.

 

How can I convert all the groups in blocks in one manipulation?

 

(Or do you know how you export directly from inventor to dwg file with blocks?)

Link to comment
Share on other sites

This was a very old post have a look for the PB function worked for the simple test I did, only hiccup is it makes $ac2dhetfb block names but you could do some form of rename after paste.

 

Link removed found original - original code by ASMI 2008

 

(defun c:pb(/ lPt)
(and(setq lPt(getvar "LASTPOINT"))
(vl-cmdf "_.copybase" lPt (ssget) "")
(vl-cmdf "_.pasteblock" lPt)
(vl-cmdf "_.erase" "_p" ""))
(princ)
); end of c:pb

 

; rename version
; original code by ASMI rename by Alan H
(defun c:pb (/ lPt)
(and(setq lPt(getvar "LASTPOINT"))
(vl-cmdf "_.copybase" lPt (ssget) "")
(vl-cmdf "_.pasteblock" lPt)
(setq objname (assoc 2 (cdr(entget (entlast))))) 
(vl-cmdf "_.erase" "_p" "")
(command "-rename" "block" (cdr objname) (getstring "Enter new name"))
)
(princ)
); end of c:pb

Edited by BIGAL
Link to comment
Share on other sites

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...