Search the Community
Showing results for tags 'bylayer'.
-
changing all nested blocks' color to bylayer
NoelStalker posted a topic in AutoLISP, Visual LISP & DCL
Hello helpful people. I'm looking for a routine to reference edit every block in my drawing and change the color of everything to "bylayer". I can make a script easily enough that will chprop all color to bylayer but that won't touch things inside blocks. What do you do when you encounter this problem? Thanks in advance! -
Hello everybody, I have written a short LISP code to do some tasks of MATCHPROP command. Here is the function: (defun MatchProp (oldobj newobj key / oldobjlist newobjlist oldassoc newassoc) (setq oldobjlist (entget oldobj)) (setq newobjlist (entget newobj)) (setq newassoc (assoc key newobjlist)) (if (setq oldassoc (assoc key oldobjlist)) (progn (if newassoc (progn (setq newobjlist (subst oldassoc newassoc newobjlist)) ) (progn; it is bylayer (setq newobjlist (append newobjlist (list oldassoc))) ) ) ) (progn; set it to bylayer (if newassoc (progn (setq newobjlist (vl-remove newassoc newobjlist)) ) ) ) ) (entmod newobjlist) ) And this is an example showing how it is called: (defun c:go() (setq oldobj (car (entsel))) (setq newobj (car (entsel))) (MatchProp oldobj newobj [color=darkslateblue][b]8[/b][/color]); [color=magenta]layer[/color] (MatchProp oldobj newobj [color=darkslateblue][b]62[/b][/color]); [color=magenta]color[/color] (MatchProp oldobj newobj [color=darkslateblue][b]420[/b][/color]); [color=magenta]color RGB[/color] (MatchProp oldobj newobj [color=darkslateblue][b]430[/b][/color]); [color=magenta]color name[/color] (MatchProp oldobj newobj [color=darkslateblue][b]6[/b][/color]); [color=magenta]linetype[/color] (MatchProp oldobj newobj [color=darkslateblue][b]48[/b][/color]); [color=magenta]linetype scale[/color] (MatchProp oldobj newobj [color=darkslateblue][b]370[/b][/color]); [color=magenta]lineweight[/color] (MatchProp oldobj newobj [color=darkslateblue][b]440[/b][/color]); [color=magenta]tranparency[/color] (MatchProp oldobj newobj [color=darkslateblue][b]390[/b][/color]); [color=magenta]plot style[/color] ) It works nice when I select an object with named color, linetype, etc. (not Bylayer), but not works vice versa at all. Could anyone checks it and show what is wrong with my program or entmod function? Thanks in advance:).
-
All I need to do is change the linetype to "OVERHEAD_ELECTRIC_SERVICE", draw a line or two, then switch back to "BYLAYER" linetype. This code I have written doesn't change the linetype at all and when I take out (setvar "celtype" "bylayer"), it works but then of course I'm out of Bylayer linetype. Somebody please help!!! This is driving me crazy (defun c:OES () (command "layer" "s" "ELECTRIC_LINE" "") (SETVAR "CELTYPE" "OVERHEAD_ELECTRIC_SERVICE") (command "LINE") (setvar "CELTYPE" "bylayer") (PRINC) )
-
Hi, I need a lisp routine to change the plot style of blocks in my drawing to 'bylayer' rather than the selected plot styles that they have been put on when they were created (by others). I would really appreciate if anyone had a lisp routine that would do this easily as there are many blocks in my drawings that need to be changed and going through the block editor is very time consuming. I have a lisp routine that can change the colour to one of my choosing but as I am not very good at lisp I do not know how to edit it to do the plot style rather than colour. Any help is greatly appreciated.
-
it was white in drawing, & when I print it will be black - it's good for me -.... but now it's same like gray, and in printing is gray