Jump to content

Text properties


ElAmigo

Recommended Posts

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.

Link to comment
Share on other sites

@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.

 

  • Like 1
Link to comment
Share on other sites

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 ?

Link to comment
Share on other sites

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 by pkenewell
Link to comment
Share on other sites

@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.

  • Like 1
Link to comment
Share on other sites

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 by pkenewell
Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...