See the top rated post in this thread. Click here

Results 1 to 7 of 7

Thread: Change the color of dim text overrides

  1. #1
    Member
    Join Date
    2005-06
    Posts
    21
    Login to Give a bone
    0

    Default Change the color of dim text overrides

    I would like to change the color of manual dim text overrides as they are created. I need a simple routine that answers 1 if/then statement: IF there is text in the dim text override property THEN change its color. Any ideas? I have next to no experience with LSP myself.

    Thanks,
    Dennis

  2. #2
    Certifiable AUGI Addict tedg's Avatar
    Join Date
    2005-06
    Location
    in the upper right corner
    Posts
    3,507
    Login to Give a bone
    0

    Default Re: Change the color of dim text overrides

    Quote Originally Posted by dennis.moyes View Post
    I would like to change the color of manual dim text overrides as they are created. I need a simple routine that answers 1 if/then statement: IF there is text in the dim text override property THEN change its color. Any ideas? I have next to no experience with LSP myself.

    Thanks,
    Dennis
    Can you explain more what you're trying to do?

    If there's TEXT added to (overridden with) a dimension, you want THAT to be a different color that you choose?
    You want to do this on existing dimensions in a drawing (find and fix)?
    You want to do that as you're adding (overriding to) TEXT?

    I don't have an answer but it could help get an answer to know more about your process.

  3. #3
    Certifiable AUGI Addict
    Join Date
    2001-03
    Location
    Tallahassee, FL USA
    Posts
    3,667
    Login to Give a bone
    0

    Default Re: Change the color of dim text overrides

    Kent Cooper's lisp modified to only change color
    Code:
    ;https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-change-color-of-dimensions-with-text-override/m-p/5107144#M323608
    (vl-load-com); [if not already done]
    (if (setq ss (ssget "_X" '((0 . "DIMENSION") (1 . "~")))); ignores no-override ones; returns nil if it finds none
      (progn ; "wrapper" to make all operations into one 'then' argument
        (command "_.layer" "_thaw" "Dimensions_Overridden Text" ""); just in case -- won't care if it doesn't exist
        (repeat (sslength ss)
          (setq en (ssname ss 0))
          (if (not (wcmatch (cdr (assoc 1 (entget en))) "*<>*")); override doesn't contain actual measurement
            (progn ; 'then'
              (if (not (tblsearch "layer" "Dimensions_Overridden Text"))
                ; doesn't already exist -- create only if not and if appropriate object(s) found
                (command "_.layer" "_new" "Dimensions_Overridden Text" "c" "6" "Dimensions_Overridden Text" "")
                  ; [no need to Thaw if new]
              ); if
              (vlax-put (setq obj (vlax-ename->vla-object en))  'Color 256); = Bylayer
            ); progn
          ); if
          (ssdel en ss)
        ); repeat
      ); progn ['then' -- no 'else' -- do nothing if none found]
    ); if [found some potentially appropriate object(s)]
    (princ)
    Change Color from 256 (ByLayer) to the color you want like 6
    His original code makes it stand out better and allows you to modify properties like the color easily by modifying the "Layer "Dimensions_Overridden Text".

  4. #4
    Member
    Join Date
    2005-06
    Posts
    21
    Login to Give a bone
    0

    Default Re: Change the color of dim text overrides

    Quote Originally Posted by tedg View Post
    Can you explain more what you're trying to do?

    If there's TEXT added to (overridden with) a dimension, you want THAT to be a different color that you choose?
    You want to do this on existing dimensions in a drawing (find and fix)?
    You want to do that as you're adding (overriding to) TEXT?

    I don't have an answer but it could help get an answer to know more about your process.
    I want to change the color when I override the text. No find and fix is necessary and I want the text to remain on the layer it was created on.

  5. #5
    All AUGI, all the time
    Join Date
    2003-07
    Posts
    560
    Login to Give a bone
    0

    Default Re: Change the color of dim text overrides

    Maybe this, needs the check for isit overidden as per Tom,s post

    Code:
    (defun c:wow ( / ent)
    (setq col (acad_colordlg 1))
    (while (setq ent (car (entsel "\nPick dim Enter to exit")))
    (vlax-put  (vlax-ename->vla-object ent)  'TextColor col)
    )
    (princ)
    )

  6. #6
    I could stop if I wanted to
    Join Date
    2001-12
    Location
    Dallas, TX
    Posts
    229
    Login to Give a bone
    1

    Default Re: Change the color of dim text overrides

    How about the attached LISP FAKEDIM.LSP

  7. #7
    Certifiable AUGI Addict tedg's Avatar
    Join Date
    2005-06
    Location
    in the upper right corner
    Posts
    3,507
    Login to Give a bone
    0

    Default Re: Change the color of dim text overrides

    Quote Originally Posted by pendean View Post
    How about the attached LISP FAKEDIM.LSP
    Just a quick look at this, seems to want to put "forged dims" on a special layer, the OP didn't want a different layer, just to change the color.
    But pretty cool concept though.

Similar Threads

  1. 2020: Change color of dim text overrides
    By dennis.moyes in forum AutoCAD General
    Replies: 7
    Last Post: 2021-08-30, 12:15 PM
  2. Replies: 3
    Last Post: 2012-12-19, 03:00 PM
  3. Dim Text Above the Dim Line
    By BeKirra in forum AutoLISP
    Replies: 21
    Last Post: 2012-06-19, 08:26 AM
  4. Replies: 4
    Last Post: 2010-02-23, 05:36 PM
  5. Retain Dmension Overrides When Creating A New Dim Style
    By inventor.wishlist1738 in forum Inventor Wish List
    Replies: 0
    Last Post: 2007-07-22, 05:17 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •