woodman78 Posted April 20, 2011 Posted April 20, 2011 Hi, I had a request from our surveyor to be able to move all blocks of a certain colour to a single layer. His software doesn't allow it to be done. He checked with the developer and they said no. I was going to create a lisp that he can run. I've used this before so I think it can probably be modified. (setq blue(ssget "x" '((62 . 5)))) (command "_change" blue "" "p" "layer" "LA0004" "color" "bylayer" "") Quote
MSasu Posted April 20, 2011 Posted April 20, 2011 Should create a filter for selection using entity type and the desired color: (ssget "_X" (list (cons 0 "INSERT") (cons 62 MyColor))) Regards, Mircea Quote
David Bethel Posted April 20, 2011 Posted April 20, 2011 Are the blocks made of ByBlock color entities and the assigned color or are the nested entities assign the color? In other words, how can you determine the inserts to filter? -David Quote
dbroada Posted April 20, 2011 Posted April 20, 2011 QSelect > ChProp?certainly the way I would do it, depending on how many drawings you have to do. Quote
woodman78 Posted April 20, 2011 Author Posted April 20, 2011 The moving of the blocks worked fine. I have this part of the code that doesn't seem to be working and I suspect it's because I tried to control the text selection by colour and it's not right. (and (setq text1(ssget "x" '((8 . "TEXT") (cons 62 70)))))(command "_.CHPROP" TEXT1 "" "_LA" "CCC_SURVEY_Level" ""))[code] Quote
MSasu Posted April 20, 2011 Posted April 20, 2011 By using QUOTE (') your list isn't evaluated; try this instead: (list '(0 . "TEXT") (cons 62 70)) Annother correction, by using the DXF code 8 means that you are looking for entities that reside in layer "TEXT" instead of text entities; the entity type is stored by DXF code 0. Regards, Mircea Quote
Lee Mac Posted April 20, 2011 Posted April 20, 2011 Read this Woodman: http://www.cadtutor.net/forum/showpost.php?p=258390&postcount=20 Quote
woodman78 Posted April 20, 2011 Author Posted April 20, 2011 Thanks Mircea, that sorted the problem. 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.