Jump to content

Recommended Posts

Posted

HELLO
I have a simple problem  and I want you to find a solution for it.
I am working on an AutoCAD drawing that contains more than 10,000 blocks with different names, and I want to SELECT about 1000 blocks so that I can transfer them to another AutoCAD file for modification.
Is there any way that I can select multiple blocks by name only (I have a list in Excel), knowing that I tried a set of commands like FILTER, QSELECT and also I tried to export blocks attribut but it didn't work for me.
Thanks.

1.jpg

2.jpg

Posted (edited)

Something like this, you would say make a csv file of your excel and make a list of the block names. Lots of examples for convert csv to list then make a list of blocknames.

 

(setq lst (list "block1" "block2" block3")) ; make this from a csv

(setq sss (ssadd ))
(foreach blk lst
(setq ss (ssget "X" (list (cons 0  "Insert")(cons 2 blk)(cons 410 "Model")))) ; only get blocks from "Model"
(repeat (setq x (sslength ss))
(setq sss (ssadd (ssname ss (setq x (1- x))) sss))
)
)

(command "copyclip" sss "")

go to other dwg and paste the selection.

 

Do you know how to write a lisp.

Edited by BIGAL

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