Lee Mac Posted November 19, 2010 Posted November 19, 2010 I would just need everything but my layers turn to ByLayer (I believe all of my layers are already ByLayer anyway). I used the revised L8.lsp, but it didn't change the layers to ByLayer. I still have color used on some of the layers. Do I need to do something different? Were they on locked layers? Also, did you load the latest code (bear in mind they have the same syntax) Quote
tasty geezer Posted November 19, 2010 Author Posted November 19, 2010 nevermind...your L8.lsp code was perfect...I just had some of the eng. layers on one of my layers from messing around with it so it didn't change it...flawless...Thanks Quote
tasty geezer Posted November 19, 2010 Author Posted November 19, 2010 As far as the mpl2.lsp it is saying: ** ALD_block.dwg Block Not Found ** where do I need to put the ALD_block.dwg to be found. I guess i didn't really understand your earlier post Quote
Lee Mac Posted November 19, 2010 Posted November 19, 2010 It depends how you want to specify the block name at the top of the code. Specify it as a full filename ("C:\\Block.dwg") and the block can be anywhere. Specify it as "block.dwg" or just "block", and the block must be in a support path. And the reverse logic applies of course. Quote
tasty geezer Posted November 19, 2010 Author Posted November 19, 2010 One more thing on the L8.lsp while I have your awesome help:D If there are blocks in the original drawing that have layers assigned by color instead of ByLayer, is it possible to have the L8.lsp also go into all of the blocks and change the layers to ByLayer? that would make for a perfect L8.lsp. I then wouldn't have to go into each individual block and manually change to ByLayer Quote
tasty geezer Posted November 19, 2010 Author Posted November 19, 2010 It depends how you want to specify the block name at the top of the code. Specify it as a full filename ("C:\\Block.dwg") and the block can be anywhere. Specify it as "block.dwg" or just "block", and the block must be in a support path. And the reverse logic applies of course. How do you recommend? Remember this is new to me, but I'm starting to get it:? So I would need to edit the code in notepad? Quote
Lee Mac Posted November 19, 2010 Posted November 19, 2010 One more thing on the L8.lsp while I have your awesome help:D If there are blocks in the original drawing that have layers assigned by color instead of ByLayer, is it possible to have the L8.lsp also go into all of the blocks and change the layers to ByLayer? that would make for a perfect L8.lsp. I then wouldn't have to go into each individual block and manually change to ByLayer (defun c:L8 ( / NewCol layers def bdef n c ss ) (vl-load-com) ;; © Lee Mac 2010 (setq NewCol ;; New Colour for Objects (setq layers (mapcar 'strcase '( ;; List your Layers Here (may use Wildcards): "LC_*" ;;------------------------------------------;; ) ) ) (while (setq def (tblnext "LAYER" (null def))) (setq n (strcase (cdr (assoc 2 def))) c (cdr (assoc 62 def))) (if (not (vl-some (function (lambda ( s ) (wcmatch n s)) ) layers ) ) ( (lambda ( tbl ) (entmod (subst (cons 62 (* NewCol (/ (abs c) c))) (assoc 62 tbl) tbl ) ) ) (entget (tblobjname "LAYER" n)) ) ) ) (while (setq bdef (tblnext "BLOCK" (null bdef))) ( (lambda ( tbl / l ) (while (setq tbl (entnext tbl)) (if (assoc 62 (setq l (entget tbl))) (if (setq l (entmod (subst (cons 62 256) (assoc 62 l) l ) ) ) (entupd tbl) ) ) ) ) (tblobjname "BLOCK" (cdr (assoc 2 bdef))) ) ) (if (setq ss (ssget "_X" (list (cons -4 "<NOT") (cons 8 (LM:lst->str layers ",")) (cons -4 "NOT>") ) ) ) ( (lambda ( i / e l ) (while (setq e (ssname ss (setq i (1+ i)))) (if (assoc 62 (setq l (entget e))) (if (setq l (entmod (subst (cons 62 256) (assoc 62 l) l ) ) ) (entupd e) ) ) ) ) -1 ) ) (princ) ) ;;-------------------=={ List to String }==-------------------;; ;; ;; ;; Constructs a string from a list of strings separating ;; ;; each element by a specified delimiter ;; ;;------------------------------------------------------------;; ;; Author: Lee Mac, Copyright © 2010 - www.lee-mac.com ;; ;;------------------------------------------------------------;; ;; Arguments: ;; ;; lst - a list of strings to process ;; ;; del - delimiter by which to separate each list element ;; ;;------------------------------------------------------------;; ;; Returns: String containing each string in the list ;; ;;------------------------------------------------------------;; (defun LM:lst->str ( lst del ) ;; © Lee Mac 2010 (if (cdr lst) (strcat (car lst) del (LM:lst->str (cdr lst) del)) (car lst) ) ) Haven't edited block definitions in Vanilla in a while, but should work ^^ Quote
Lee Mac Posted November 19, 2010 Posted November 19, 2010 How do you recommend? Remember this is new to me, but I'm starting to get it:? Well, it depends where your block is. If your block is in a support path, then just "block.dwg" or "block" will do. Otherwise, if its elsewhere, you'll need to specify the full filename (eg. "C:\\My Folder\\My Block.dwg" - using double-backslashes) So I would need to edit the code in notepad? Yes - the relevant parts I marked in blue, or better yet, use the VLIDE - info here. Quote
tasty geezer Posted November 19, 2010 Author Posted November 19, 2010 ok...I know have the PERFECT L8.lsp! Thank You Lee Mac! Quote
Lee Mac Posted November 19, 2010 Posted November 19, 2010 ok...I know have the PERFECT L8.lsp! Thank You Lee Mac! You're welcome Quote
tasty geezer Posted November 19, 2010 Author Posted November 19, 2010 Lee Mac, Attached is how the ALD block is inserting into my drawing. Also, is it possible to have it insert at whatever scale I have model space set to? I change scale in model space frquently for details and such so that my notes and symbols are all the same size in their respective viewports in paper space...Just curious... test routines.dwg Quote
Lee Mac Posted November 19, 2010 Posted November 19, 2010 Attached is how the ALD block is inserting into my drawing. Yes, this is per my comment about the block definition file - open your ALD_Block, set the UCS to World, View to Top, and rotate & move everything so that the origin is where you want the block base point to be (you'll need to rotate by 30degrees judging by the file). Alternatively, WBlock it out. Also, is it possible to have it insert at whatever scale I have model space set to? I change scale in model space frquently for details and such so that my notes and symbols are all the same size in their respective viewports in paper space...Just curious... Did you not read the parts I marked blue? Quote
tasty geezer Posted November 19, 2010 Author Posted November 19, 2010 (setq scl (getvar 'DIMSCALE)) ;; Model Space Scale? (I thought ModelSpace was 1:1...) I did:unsure:. So to edit this so that it automatically inserts at model space scale I would do what? I'm not too clear on how to change this. Quote
Lee Mac Posted November 19, 2010 Posted November 19, 2010 I didn't know what you meant by 'Model Space Scale' (as per my comment), so, as you can see, I used the DIMSCALE value... Quote
tasty geezer Posted November 19, 2010 Author Posted November 19, 2010 ok...so if I change the DIMSCALE it changes the block scale...that is what I ultimately wanted. Works beautiful. Thanks so much Mac! Thanks for the links as well...time to do some reading! Just from this one thread I've jumped to Junior Member...That doesn't seem right:lol:...I've got alot to learn. Quote
Lee Mac Posted November 19, 2010 Posted November 19, 2010 ok...so if I change the DIMSCALE it changes the block scale.. Well, that wasn't really my intention - you shouldn't have to change anything really, the code should detect what scale to insert the block at. What did you mean by 'Model Space Scale'? Quote
tasty geezer Posted November 19, 2010 Author Posted November 19, 2010 which it does...If I am laying out a drawing at 1/4"=1'-0" the block inserts at the correct scale. If I start drawing a 1"=1'-0" detail in the same model space, I change the DIMSCALE and insert the ALD block again at the new scale. That way in paper space when I have a layout with different viewports that have different scales my text and symbols are all the same size on the sheet. Make sense? I believe when I was refering to Model space Scale, I really was refering to DIMSCALE...sorry for the confusion, it has been awhile and my terminology isn't back to par yet! Quote
Lee Mac Posted November 19, 2010 Posted November 19, 2010 But isn't everything in ModelSpace at 1:1? Quote
tasty geezer Posted November 19, 2010 Author Posted November 19, 2010 if my viewport in Paper space is set to 1/4"=1'-0", then I want my ALD block to insert into model space at the 1/4" scale. Then If I have a detail that is at 1"=1'-0" in paper space I want to insert a new ALD block at that scale. Does that make sense? Maybe what I am looking for is for the ALD block to insert at whatever the LTSCALE is set to? Quote
tasty geezer Posted November 19, 2010 Author Posted November 19, 2010 maybe there is an easier way to do what I'm trying to do, I have just been out of the game for awhile now and don't know any other way 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.