Elizanoloo Posted August 21, 2014 Share Posted August 21, 2014 Hey, So I have received a few (15) drawings from an architect and I am compiling them in an overall xref so we can then work around it. Each drawing has several blocks all with color set bylayer, but within the blocks a lot of the lines are set by different colors. What I am trying to do is change all the magenta colored lines to number 8, without changing the rest. So far I had to go into each block, select all the magenta lines using filter, and then changing them to number 8. I am aware of commands such as setbylayer, but in this case they would not work as the layer color is green and the rest of the linework is fine. Changing plot settings, although very quick, is not an option. We have global setting that we use throughout the office and would create a bunch of other problems. I know I am kind of reaching here a bit, but does anyone have any thoughts or knows of any lisps that might make this tedious job a little bit faster. Cheers Quote Link to comment Share on other sites More sharing options...
RobDraw Posted August 21, 2014 Share Posted August 21, 2014 If the assigned layer color cannot be changed, then you have to edit each block. If you are finding yourself editing the same blocks multiple times across multiple files, there might be a better solution. Quote Link to comment Share on other sites More sharing options...
BIGAL Posted August 22, 2014 Share Posted August 22, 2014 Heres a start for you, you would need to change the put-color to get-color then a IF = 6 vla-put-color 8 (vl-load-com) (setq adoc (vla-get-activedocument (vlax-get-acad-object))) (vla-startundomark adoc) (vlax-for block (vla-get-blocks adoc) (if (not (wcmatch (strcase (vla-get-name block) t) "*_space*")) (vlax-for ent block (vla-put-color ent 0) (vla-put-linetype ent "Bylayer") (vla-put-lineweight ent aclnwtbyblock) ) ;_ end of vlax-for ) ;_ end of if ) ;_ end of vlax-for (vla-regen adoc acactiveviewport) (vla-endundomark adoc) (princ) Quote Link to comment Share on other sites More sharing options...
Elizanoloo Posted August 22, 2014 Author Share Posted August 22, 2014 Hey, Thanks to both of you. RobDraw, that is exactly what I ended up doing, and unfortunately the blocks were not even the same on the different drawings. I just spend a whole day just preparing an xref... BIGAL, I am a little familiar with lisps but not so much as to take your start and further it as a viable solution. If you have time to finish it I would be grateful. I did end up having to go through all the blocks, but it would be great for future use to have something. Have a lovely weekend Quote Link to comment Share on other sites More sharing options...
BIGAL Posted August 23, 2014 Share Posted August 23, 2014 check color if so change (vl-load-com) (setq adoc (vla-get-activedocument (vlax-get-acad-object))) (vla-startundomark adoc) (vlax-for block (vla-get-blocks adoc) (if (not (wcmatch (strcase (vla-get-name block) t) "*_space*")) (vlax-for ent block (if (= (vla-get-color ent ) 6) (vla-put-clor ent ) (vla-put-linetype ent "Bylayer") (vla-put-lineweight ent aclnwtbyblock) ) ;_ end of vlax-for ) ;_ end of if ) ;_ end of vlax-for (vla-regen adoc acactiveviewport) (vla-endundomark adoc) (princ) Quote Link to comment Share on other sites More sharing options...
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.