Jump to content

Change multiple groups to blocks


vimcruz

Recommended Posts

Hi, there. It's been a while since I posted here. Lots of work :ouch:

 

The problem I'm facing now is this:

 

The designer (begginer) of our autocad project made lots of groups to make an hidraulic train. Per say, he drew each piece as a group, like pipes, sensors and so on. That in order to use copy->drag & drop.

 

The problem with this is that I want to extract the group info (nothing) to get the name of the piece, inches, and other attributes. But I cannot, because they are not blocks :S. Anyhow I've been practicing with this, I just have the main idea on how to export this properties to a file.

 

The question is: Is there any way that I could change every matching copy of the group into the same block (that I'm guessing have to do it by hand) with its properties?

 

Regards

Edited by vimcruz
Link to comment
Share on other sites

  • 3 weeks later...

You could get all entities of a group by this code:

(defun c:test()
 (setq a (car (entsel "\nChoose a group:")))
 (if (assoc 102 (entget a))
   (progn
     (setq b (assoc 330 (entget a)))
     (vl-remove-if-not '(lambda(x) (member b (entget x)))
  (vl-remove-if 'listp (mapcar 'cadr (ssnamex (ssget "X"))))))
 )
)

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