ElAmigo Posted February 26 Posted February 26 Hi, I'm trying to write a program that changes the text properties of everything selected in a certain layer. I wrote a LISP program that takes everything from layer X and puts it in layer Y. These are all rotated dimensions. After it gets to layer Y, I have to change the Text color from ByLayer to Yellow. But I can't find out if this is possible. I hope someone can help me. Quote
pkenewell Posted February 26 Posted February 26 @ElAmigo this is fairly easy and doesn't necessarily require a LISP routine unless you are trying to incorporate it into you existing routine. If that is the case: (setq ss (ssget "X" '((0 . "DIMENSION")(8 . "LayerY")))) (command "._dimoverride" "DIMCLRT" 2 "" ss "");<--Overrides the dimension text color to make it yellow. 1 Quote
ElAmigo Posted February 26 Author Posted February 26 20 minutes ago, pkenewell said: @ElAmigo this is fairly easy and doesn't necessarily require a LISP routine unless you are trying to incorporate it into you existing routine. If that is the case: (setq ss (ssget "X" '((0 . "DIMENSION")(8 . "LayerY")))) (command "._dimoverride" "DIMCLRT" 2 "" ss "");<--Overrides the dimension text color to make it yellow. Thank you very much! I am new to this and trying to learn LISP and AutoCAD at the same time. Could you perhaps also help me change the text style from X to Y ? Quote
pkenewell Posted February 26 Posted February 26 (edited) 20 minutes ago, ElAmigo said: Could you perhaps also help me change the text style from X to Y ? (command "._dimoverride" "DIMTXSTY" "StyleY" "" ss "") ;; You can also incorporate both into the same command string: (command "._dimoverride" "DIMCLRT" 2 "DIMTXSTY" "StyleY" "" ss "") NOTE: This does not update the dimension style, only overrides the selected dimensions from the defaults for that dimension style. Edited February 26 by pkenewell Quote
Jonathan Handojo Posted February 26 Posted February 26 @pkenewell Though this might sound silly (and to my knowledge), I haven't found a method in which you use a script or macro to select all objects in a layer devoid of AutoLISP. And QSELECT uses a GUI to prompt the user, so it's impossible to use that in a macro or script. Perhaps someone can correct me on this. 1 Quote
pkenewell Posted February 26 Posted February 26 (edited) 35 minutes ago, Jonathan Handojo said: @pkenewell Though this might sound silly (and to my knowledge), I haven't found a method in which you use a script or macro to select all objects in a layer devoid of AutoLISP. And QSELECT uses a GUI to prompt the user, so it's impossible to use that in a macro or script. Perhaps someone can correct me on this. You are correct in the case of a script or macro. I meant just manually in the drawing. I had actually intended to add that, but was thinking "he is wanting to incorporate it into his existing routine" so I ended up not mentioning it. Thanks for the clarification. Edited February 26 by pkenewell 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.