RMerrell Posted April 30, 2009 Posted April 30, 2009 I work at a landscape architecture firm. We are using ACAD 2010. We do mostly vegetation on structure so we usually work with architects to incorporate their backgrounds into our drawings then draw our areas of responsibility using their backgrounds as underlays. This is done by xref'ing their backgrounds into our sheet set then drawing on top of their xrefs. We want our areas of responsibility to pop out so that it is easily distinguishable from the architects areas of responsibility. Our current procedure is to perform some layer management on the arch backgrounds before xref'ing. Since each architect uses there own CTB file it would be impossible and impractical for us to try to learn a new CTB set up for each project. Therefore the layer management required involves changing all objects to color by layer and then changing all layers to a 60% screened color. Thats very easy to do and only takes a minute or two at most. We get new backgrounds on some projects on a weekly basis, so this procedure isn't to bad. However, the problems arise with blocks. If items within blocks are assigned a color instead of color by layer or color by block, then those colors won't change. I found a LISP routine called "fixblock" which converts items within a block to color by block. This program works well except when there are nested blocks. It will not work on nested blocks. Many of the blocks within the arch backgrounds have nested blocks, so this process becomes very time consuming and arduous. And for the projects we receive weekly updates, it becomes rediculous. This is compounded if the arch sends backgrounds that have their in house xrefs bounded to the drawings. I don't want to explode the blocks because that usually just creates a huge pandora's box of additional problems. So, I said all that to say this... It seems like there should be a way to fade xrefs easily to accomplish our task. I know in 2010 you can now xref PDFs and fade the pdf, it seems like I should be able to do the same thing with a xref'd DWG. I thought about changing our procedures to use PDFs generated from the arch backgrounds, but there are some issues with this method as well that need to be flushed out, such as a consistent print window and consistent scale from background to background and not being able to update the PDF while the DWG file that is xref'ing the PDF is open and the PDF disappears when I zoom out a little bit, then reappears once I zoom back in. Any suggestions on this issue would be greatly appreciated. Robert Merrell Quote
RMerrell Posted April 30, 2009 Author Posted April 30, 2009 That works perfectly!! You wouldn't believe how much time I have wasted with this issue. I can't believe I am just now figuring this out. It makes me wonder how many other nifty little tidbits there are that I don't know about. Thanks again. Robert Quote
ronjonp Posted April 30, 2009 Posted April 30, 2009 Glad to help . FWIW...the setbylayer command is a relatively new addition to AutoCAD. Quote
tzframpton Posted April 30, 2009 Posted April 30, 2009 I have had the same issue for the past two and a half years. I am in heaven. Why didn't I know about this either? man this thread needs to be a sticky, lol. Thanks a million 1st off to Merrell for asking this question, and to RonJon for answering. This tool is already on the Tool Palettes for our XREF setups..... I vote SETBYLAYER as new command of the year. Quote
Jack_O'neill Posted May 1, 2009 Posted May 1, 2009 Why didn't I know about this either? man this thread needs to be a sticky, lol. Autocad is a huge and extremely powerful and flexible bit of programming. I've been using it since release 9, and while I consider myself to be pretty good at it, I probably don't fully utilize half of what it's capable of. I agree with you Stik....this is a great bit of info. Quote
Zorg Posted May 7, 2009 Posted May 7, 2009 Everyweek i find a new command or tool that will potentially save me hours of time in future and makes me a better employee and better CAD operator. Thanks to all the contributors of CADtutor for leading the way Z Quote
MS-S Posted October 1, 2009 Posted October 1, 2009 Glad to help . FWIW...the setbylayer command is a relatively new addition to AutoCAD. Is there anything similar for 2007? Quote
chelsea1307 Posted October 2, 2009 Posted October 2, 2009 This lsp will set all blocks to bylayer as long as you have full and not LT, if you have LT i think you are out of luck Author kpblc changes all blocks inserted in a dwg from by block/color to by layer. (defun c:norm (/ *error* adoc lst_layer func_restore-layers) (defun *error* (msg) (func_restore-layers) (vla-endundomark adoc) (princ msg) (princ) ) ;_ end of defun (defun func_restore-layers () (foreach item lst_layer (vla-put-lock (car item) (cdr (assoc "lock" (cdr item)))) (vl-catch-all-apply '(lambda () (vla-put-freeze (car item) (cdr (assoc "freeze" (cdr item)))) ) ;_ end of lambda ) ;_ end of vl-catch-all-apply ) ;_ end of foreach ) ;_ end of defun (vl-load-com) (vla-startundomark (setq adoc (vla-get-activedocument (vlax-get-acad-object))) ) ;_ end of vla-startundomark (vlax-for item (vla-get-layers adoc) (setq lst_layer (cons (list item (cons "lock" (vla-get-lock item)) (cons "freeze" (vla-get-freeze item)) ) ;_ end of list lst_layer ) ;_ end of cons ) ;_ end of setq (vla-put-lock item :vlax-false) (vl-catch-all-apply '(lambda () (vla-put-freeze item :vlax-false))) ) ;_ end of vlax-for (vlax-for blk (vla-get-blocks adoc) (if (and (equal (vla-get-islayout blk) :vlax-false) (equal (vla-get-isxref blk) :vlax-false) ) ;_ end of and (progn (vlax-for subent blk ;(vla-put-layer subent "0");edit-> removed force to layer 0 (vla-put-color subent 256) (vla-put-lineweight subent aclnwtbyblock) (vla-put-linetype subent "byblock") ) ;_ end of vlax-for ) ;_ end of progn ) ;_ end of if ) ;_ end of vlax-for (func_restore-layers) (vla-endundomark adoc) (command "_regenall") (princ) ) ;_ end of defun Quote
MS-S Posted October 2, 2009 Posted October 2, 2009 This great, and I really appreciate you sharing this lisp with me. However, how do I activate it? I don't see a command.... I copied the lisp to my acad.lisp file, which I assume was the correct thing to do. Thanks for your help! Quote
chelsea1307 Posted October 2, 2009 Posted October 2, 2009 I usually save each lisp as its own .lsp file through note pad. The command to invoke it is norm. You find it after (defun c: Quote
MS-S Posted October 2, 2009 Posted October 2, 2009 This is fantastic! I can't thank you enough for all your help with this matter. Have a great weekend! Quote
chelsea1307 Posted October 2, 2009 Posted October 2, 2009 not a problem! Have a good weekend too! 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.