TAHA Posted August 25, 2022 Posted August 25, 2022 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. Quote
BIGAL Posted August 26, 2022 Posted August 26, 2022 (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 August 26, 2022 by BIGAL Quote
Recommended Posts
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.