Results 1 to 5 of 5

Thread: Changing dimension variables

  1. #1
    100 Club
    Join Date
    2004-12
    Posts
    153

    Default Changing dimension variables

    Our firm awhile back changed the way the dimension strings look. They went from the dots to the architectural ticks, and tweaked a few other things. I took one of our newer drawings, and captured all of the dimension variables, copied them to a notepad file, and then created a lisp routine based around those settings. The lisp routine runs fine, and all of the variables change, but when i go to update the dimensions, it will not update the dimension strings! I go into "ddim" and all of the variables are set correctly, it just won't let me update the existing dimensions, or make new dimensions with the changed variables. It keeps reverting back to the old dimension style. I did notice that when i go to the properties window, the dimension string is getting a $0 at the end of it, and when i change it to the proper dimension it accepts the new variables. But if i do a dim update after that, it jumps back to the $0 dimstyle.

    Am I missing SOMETHING??

    Here's the lisp if that helps

    (DEFUN C:CGA4()(COMMAND "DIM" "DIMADEC" "0" "DIMALT" "OFF" "DIMALTD" "2" "DIMALTF" "25.4000" "DIMALTRND" "0" "DIMALTTD" "2" "DIMALTTZ" "0" "DIMASZ" "1/16" "DIMATFIT" "3" "DIMAUNIT" "0" "DIMAZIN" "0" "DIMBLK" "ARCHTICK" "DIMCEN" "0" "DIMCLRD" "7" "DIMCLRE" "256" "DIMCLRT" "4" "DIMDEC" "4" "DIMDLE" "0" "DIMDLI" "1/8" "DIMDSEP" "." "DIMEXE" "1/8" "DIMEXO" "1/8" "DIMFRAC" "2" "DIMGAP" "1/16" "DIMJUST" "0" "DIMLDRBLK" "." "DIMLFAC" "1.000" "DIMLIM" "OFF" "DIMLUNIT" "4" "DIMLWD" "-1" "DIMLWE" "-2" "DIMRND" "1/8" "DIMSAH" "OFF" "DIMSCALE" "48.0000" "DIMSD1" "OFF" "DIMSD2" "OFF" "DIMSE1" "OFF" "DIMSE2" "OFF" "DIMSOXD" "OFF" "DIMTAD" "1" "DIMDEC" "4" "DIMTFAC" "1.0000" "DIMTIH" "OFF" "DIMTIX" "OFF" "DIMTIM" "0" "DIMTMOVE" "2" "DIMTOFL" "OFF" "DIMTOH" "OFF" "DIMTOL" "OFF" "DIMTOLJ" "1" "DIMTP" "0" "DIMTSZ" "0" "DIMTVP" "0.0000" "DIMTXSTY" "CGA-TEXT" "DIMTXT" "5/64" "DIMTZIN" "0" "DIMUPT" "OFF" "DIMZIN" "3" "SAVE" "CGA-4" "y" "E" ENTER))

    Thank you in advance.
    Last edited by tyeelaw13; 2006-02-02 at 10:53 PM.

  2. #2
    AUGI Addict kennet.sjoberg's Avatar
    Join Date
    2002-05
    Posts
    1,706

    Default Re: Changing dimension variables

    You must change the variables in the dimensionstyle.
    You may use the Dimension Style Manager Command: '_dimstyle

    : ) Happy Computing !

    kennet

  3. #3
    100 Club
    Join Date
    2004-12
    Posts
    153

    Default Re: Changing dimension variables

    The variables are saved correctly in the dimstyle, and when i go to the dimension style manager, everything looks as it should. However, the drawing creates a dimension style with "$0" at the end of it, and the only way i can see that is through the properties command. It doesn't show up anywhere else. If I use the "dim" "up" command it saves the dimension string back to the "cga-4$0" dimstyle, even though i've got the "cga-4" set current.

    Thanks again.

  4. #4
    Administrator Opie's Avatar
    Join Date
    2002-01
    Location
    jUSt Here (a lot)
    Posts
    6,836

    Default Re: Changing dimension variables

    Quote Originally Posted by tyeelaw13
    The variables are saved correctly in the dimstyle, and when i go to the dimension style manager, everything looks as it should. However, the drawing creates a dimension style with "$0" at the end of it, and the only way i can see that is through the properties command. It doesn't show up anywhere else. If I use the "dim" "up" command it saves the dimension string back to the "cga-4$0" dimstyle, even though i've got the "cga-4" set current.

    Thanks again.
    I have tried your code as posted. I could not get that "$0" style. How do execute the dimensions? Do you have macro that may change any of the dimension variables?

    I also noticed that the variable "DIMTIM" should probably be "DIMTM", as there is not a variable of the former.

    Here is some code that sets most of the variables through the SETVAR command. It also checks to see if the text style is created. If it is not then that variable is not changed. You would need to add the necessary code to add the text style if it is not currently in the drawing.
    Code:
    (defun C:CGA4 ( / dstyle cmde)
      (setq cmde (getvar "cmdecho"))
      (setvar "cmdecho" 0)
      (setq DSTYLE "CGA-4")
      (command "DIM"
    	   "SAVE"
    	   DSTYLE
    	   (if (tblsearch "DIMSTYLE" DSTYLE)
    	     "y"
    	   )
    	   "E"
      )
      (setvar "DIMADEC" 0)
      (setvar "DIMALT" 0)
      (setvar "DIMALTD" 2)
      (setvar "DIMALTF" 25.4000)
      (setvar "DIMALTRND" 0)
      (setvar "DIMALTTD" 2)
      (setvar "DIMALTTZ" 0)
      (setvar "DIMASZ" (/ 1.0 16.0))
      (setvar "DIMATFIT" 3)
      (setvar "DIMAUNIT" 0)
      (setvar "DIMAZIN" 0)
      (setvar "DIMBLK" "ARCHTICK")
      (setvar "DIMCEN" 0)
      (setvar "DIMCLRD" 7)
      (setvar "DIMCLRE" 256)
      (setvar "DIMCLRT" 4)
      (setvar "DIMDEC" 4)
      (setvar "DIMDLE" 0)
      (setvar "DIMDLI" (/ 1.0 8.0))
      (setvar "DIMDSEP" ".")
      (setvar "DIMEXE" (/ 1.0 8.0))
      (setvar "DIMEXO" (/ 1.0 8.0))
      (setvar "DIMFRAC" 2)
      (setvar "DIMGAP" (/ 1.0 16.0))
      (setvar "DIMJUST" 0)
      (setvar "DIMLDRBLK" ".")
      (setvar "DIMLFAC" 1.000)
      (setvar "DIMLIM" 0)
      (setvar "DIMLUNIT" 4)
      (setvar "DIMLWD" -1)
      (setvar "DIMLWE" -2)
      (setvar "DIMRND" (/ 1.0 8.0))
      (setvar "DIMSAH" 0)
      (setvar "DIMSCALE" 48.0000)
      (setvar "DIMSD1" 0)
      (setvar "DIMSD2" 0)
      (setvar "DIMSE1" 0)
      (setvar "DIMSE2" 0)
      (setvar "DIMSOXD" 0)
      (setvar "DIMTAD" 1)
      (setvar "DIMDEC" 4)
      (setvar "DIMTFAC" 1.0000)
      (setvar "DIMTIH" 0)
      (setvar "DIMTIX" 0)
      (setvar "DIMTM" 0)
      (setvar "DIMTMOVE" 2)
      (setvar "DIMTOFL" 0)
      (setvar "DIMTOH" 0)
      (setvar "DIMTOL" 0)
      (setvar "DIMTOLJ" 1)
      (setvar "DIMTP" 0)
      (setvar "DIMTSZ" 0)
      (setvar "DIMTVP" 0.0000)
      (if (tblsearch "STYLE" "CGA-TEXT")
        (setvar "DIMTXSTY" "CGA-TEXT")
      )
      (setvar "DIMTXT" (/ 5.0 64.0))
      (setvar "DIMTZIN" 0)
      (setvar "DIMUPT" 0)
      (setvar "DIMZIN" 3)
      (command "DIM" "SAVE" "CGA-4" "y" "E")
      (setvar "cmdecho" cmde)
      (princ)
    )
    If you have a technical question, please find the appropriate forum and ask it there.
    You will get a quicker response from your fellow AUGI members than if you sent it to me via a PM or email.
    jUSt

  5. #5
    Member
    Join Date
    2006-08
    Posts
    38

    Default Re: Changing dimension variables

    Hi,

    I am trying to change the color of dimension styles.

    Let's say I have 3 dimension styles: dim1, dim2 and dim3

    Can I use DIMCLRT to set dim2's text color to white?

    I tried:
    Code:
    if (tblsearch "DIMSTYLE" dim2
    (setvar "DIMCLRT" 7)
    )
    But it didn't change the text color...
    Last edited by thomas.glasgow; 2007-03-06 at 11:36 PM.

Similar Threads

  1. Output a list of all the dimension variables
    By pbrumberg in forum AutoCAD General
    Replies: 5
    Last Post: 2007-06-04, 01:52 PM
  2. Replies: 3
    Last Post: 2005-01-21, 08:38 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
  •