Page 1 of 3 123 LastLast
Results 1 to 10 of 31

Thread: Text Override in Dimension

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    AUGI Addict
    Join Date
    2006-04
    Location
    (getpoint "Anywhere on the Enter Key =>")
    Posts
    1,160
    Login to Give a bone
    0

    Default Text Override in Dimension

    Hi ALL,
    Does anyone know how to override the text in dimension?
    For example, replace the default dimension value with the text of "Wall to Wall".

    Your helps are much appreciated.

  2. #2
    All AUGI, all the time
    Join Date
    2015-10
    Location
    Belgrade, Serbia, Europe
    Posts
    564
    Login to Give a bone
    0

    Default Re: Text Override in Dimension

    I don't quite understand your question, or I do but it's simple :

    Code:
    (defun c:dimwall ( / edim)
    (vl-load-com)
    (setq edim (vlax-ename->vla-object (car (entsel "\Select dimension to replace value"))) )
    (vla-put-TextOverride edim "Wall to Wall")
    (princ)
    )

  3. #3
    Administrator BlackBox's Avatar
    Join Date
    2009-11
    Posts
    5,719
    Login to Give a bone
    0

    Default Re: Text Override in Dimension

    Quote Originally Posted by marko_ribar View Post
    I don't quite understand your question, or I do but it's simple :

    Code:
    (defun c:dimwall ( / edim)
    (vl-load-com)
    (setq edim (vlax-ename->vla-object (car (entsel "\Select dimension to replace value"))) )
    (vla-put-TextOverride edim "Wall to Wall")
    (princ)
    )
    (vlax-ename->vla-object nil)

    Consider this example:

    Code:
    (defun c:DTOR () (c:DimTextOverride))
    (defun c:DimTextOverride  ( / ss textString)
      (princ "\rDIMENSION TEXT OVERRIDE ")
      (vl-load-com)
      (if (and (setq ss (ssget '((0 . "DIMENSION"))))
               (setq textString
                      (getstring
                        T
                        "\nEnter override text, <Enter> to remove override: ")))
        (progn
          (vla-startundomark
            (cond (*activeDoc*)
                  ((setq *activeDoc*
                          (vla-get-activedocument
                            (vlax-get-acad-object))))))
          (vlax-for oDim
                    (setq ss (vla-get-activeselectionset *activeDoc*))
            (vla-put-textoverride oDim textString))
          (vla-delete ss)
          (vla-endundomark *activeDoc*))
        (prompt "\n** Nothing selected ** "))
      (princ))
    "How we think determines what we do, and what we do determines what we get."

    Sincpac C3D ~ Autodesk Exchange Apps

    Computer Specs:
    Dell Precision 3660, Core i9-12900K 5.2GHz, 64GB DDR5 RAM, PCIe 4.0 M.2 SSD (RAID 0), 16GB NVIDIA RTX A4000

  4. #4
    Member
    Join Date
    2017-08
    Posts
    2
    Login to Give a bone
    0

    Default Re: Text Override in Dimension

    marko i love this lisp
    its simple and doing the work
    i want to combine it in my lisp
    how can i change it that automaticlly he change the last dimmension that was drawing?
    thx ahead

    Quote Originally Posted by marko_ribar View Post
    I don't quite understand your question, or I do but it's simple :

    Code:
    (defun c:dimwall ( / edim)
    (vl-load-com)
    (setq edim (vlax-ename->vla-object (car (entsel "\Select dimension to replace value"))) )
    (vla-put-TextOverride edim "Wall to Wall")
    (princ)
    )

  5. #5
    AUGI Addict
    Join Date
    2008-02
    Posts
    1,141
    Login to Give a bone
    0

    Default Re: Text Override in Dimension

    Here's one I did last month for someone...

    DosLib isn't required (just my subroutine), but if you have it loaded, it's a bit nicer since it loads by the cursor position instead of the screen center.

    Fill the 'lst' variable with whatever you like.

    Code:
    (defun c:DQE (/ lst ss str i)
      ;; Alan J. Thompson, 04.21.11
    
      (setq lst '("<>" "± VIF" "EQ." "± VERIFY"))
    
      (if (and (setq ss (ssget "_:L" '((0 . "*DIMENSION*"))))
               (setq str (if dos_popupmenu
                           (dos_popupmenu lst)
                           (car (AT:ListSelect "Select dimension override:" "" 10 10 "false" lst))
                         )
               )
               (or (eq (type str) 'STR) (setq str (nth str lst)))
          )
        (repeat (setq i (sslength ss))
          (entmod (list (cons 1 str) (cons -1 (ssname ss (setq i (1- i))))))
        )
      )
      (princ)
    )
    
    (defun AT:ListSelect (title label height width multi lst / fn fo d item f)
      ;; List Select Dialog (Temp DCL list box selection, based on provided list)
      ;; title - list box title
      ;; label - label for list box
      ;; height - height of box
      ;; width - width of box
      ;; multi - selection method ["true": multiple, "false": single]
      ;; lst - list of strings to place in list box
      ;; Alan J. Thompson, 09.23.08 / 05.17.10 (rewrite)
      (setq fo (open (setq fn (vl-filename-mktemp "" "" ".dcl")) "w"))
      (foreach x (list (strcat "list_select : dialog { label = \"" title "\"; spacer;")
                       (strcat ": list_box { label = \"" label "\";" "key = \"lst\";")
                       (strcat "allow_accept = true; height = " (vl-princ-to-string height) ";")
                       (strcat "width = " (vl-princ-to-string width) ";")
                       (strcat "multiple_select = " multi "; } spacer; ok_cancel; }")
                 )
        (write-line x fo)
      )
      (close fo)
      (new_dialog "list_select" (setq d (load_dialog fn)))
      (start_list "lst")
      (mapcar (function add_list) lst)
      (end_list)
      (setq item (set_tile "lst" "0"))
      (action_tile "lst" "(setq item $value)")
      (setq f (start_dialog))
      (unload_dialog d)
      (vl-file-delete fn)
      (if (= f 1)
        ((lambda (s / i s l)
           (while (setq i (vl-string-search " " s))
             (setq l (cons (nth (atoi (substr s 1 i)) lst) l))
             (setq s (substr s (+ 2 i)))
           )
           (reverse (cons (nth (atoi s) lst) l))
         )
          item
        )
      )
    )

  6. #6
    AUGI Addict
    Join Date
    2006-04
    Location
    (getpoint "Anywhere on the Enter Key =>")
    Posts
    1,160
    Login to Give a bone
    0

    Default Re: Text Override in Dimension

    Thanks to everyone's help.
    Much appreciated.
    MR's one is what I am looking for.
    RenderMan & Alan's give options to the user to enter various inputs, which are even better.
    I will look into it and learn.
    Thanks again.

  7. #7
    Member
    Join Date
    2015-11
    Location
    Highlands ranch, CO
    Posts
    29
    Login to Give a bone
    0

    Default Re: Text Override in Dimension

    Hey Alan, Thanks for your routine. I have tried to change it so that there is an option for a "typical" text that shows underneath the dimension. I usually open up the properties pallete and and in the text override section I put <>\X(TYP.). But when I put it in your code. the slash doesn't carry over. any suggestions on how to get this to work?

    Here is what I changed...
    Code:
    (defun c:DQE (/ lst ss str i)
      ;; Alan J. Thompson, 04.21.11
    
      (setq lst '("<>" "<>\X(TYP.)" "EQ." "± VERIFY"))  ;;;< < < < The change is in this line < < < <
    
      (if (and (setq ss (ssget "_:L" '((0 . "*DIMENSION*"))))
               (setq str (if dos_popupmenu
                           (dos_popupmenu lst)
                           (car (AT:ListSelect "Select dimension override:" "" 10 10 "false" lst))
                         )
               )
               (or (eq (type str) 'STR) (setq str (nth str lst)))
          )
        (repeat (setq i (sslength ss))
          (entmod (list (cons 1 str) (cons -1 (ssname ss (setq i (1- i))))))
        )
      )
      (princ)
    )

  8. #8
    I could stop if I wanted to
    Join Date
    2009-03
    Location
    London, England
    Posts
    304
    Login to Give a bone
    0

    Default Re: Text Override in Dimension

    Hi Greg,

    Haven't properly looked over the code, but remember that "\" will need to be "\\" in LISP, otherwise it is interpreted as an escape character.

  9. #9
    AUGI Addict
    Join Date
    2008-02
    Posts
    1,141
    Login to Give a bone
    0

    Default Re: Text Override in Dimension

    Quote Originally Posted by greg.battin View Post
    Hey Alan, Thanks for your routine. I have tried to change it so that there is an option for a "typical" text that shows underneath the dimension. I usually open up the properties pallete and and in the text override section I put <>\X(TYP.). But when I put it in your code. the slash doesn't carry over. any suggestions on how to get this to work?
    You're very welcome.

    As Lee said, "\" should always be typed in as "\\". Change your string to "<>\\X(TYP.)" and you should be golden.

  10. #10
    Member
    Join Date
    2015-11
    Location
    Highlands ranch, CO
    Posts
    29
    Login to Give a bone
    0

    Default Re: Text Override in Dimension

    Cool !! Works perfectly now
    Thanks guys
    see ya back at the swamp

Page 1 of 3 123 LastLast

Similar Threads

  1. Add Pre-Filled Text Dropdowns to the Dimension Text Override Dialogue
    By Wish List System in forum Revit Structure - Wish List
    Replies: 1
    Last Post: 2016-10-12, 01:38 PM
  2. Dimension text override to wrap
    By jgratton in forum AutoCAD General
    Replies: 13
    Last Post: 2012-03-10, 11:50 AM
  3. Dimension Text override issues
    By irchrismm in forum AutoCAD General
    Replies: 7
    Last Post: 2008-06-03, 12:48 PM
  4. Dimension text override
    By Julesagain in forum Design Review - Wish List
    Replies: 0
    Last Post: 2007-10-03, 02:41 PM
  5. Dimension Text Override with Autolisp
    By CADdancer in forum AutoLISP
    Replies: 3
    Last Post: 2005-07-12, 05:33 PM

Posting Permissions

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