Results 1 to 6 of 6

Thread: Custom Tool Buttons

  1. #1
    Active Member
    Join Date
    2008-05
    Posts
    58
    Login to Give a bone
    0

    Default Custom Tool Buttons

    I'd like to have some Dimension Buttons that always place the new dimension on a specific layer, regardless of what is current. Any Ideas?

  2. #2
    100 Club
    Join Date
    2008-11
    Location
    Fort Lewis, WA.
    Posts
    119
    Login to Give a bone
    0

    Default Re: Custom Tool Buttons

    Here is what I use. Feel free to change it however you want.

    Code:
    ;;;----------------------------------------------------------------------------------------
    ;;;Sets the Dims
    ;;;
    (Defun C:SetDims ()
      (command "cmdecho" "0")
      (Command
        "_-Style"  "Arial"			;Name of text style that is created
        "Arial.ttf"			;Specify full font name or font filename (TTF or SHX)
        "0"				;Specify height of text
        "1"				;Specify width factor
        "0"				;Specify obliquing angle
        "_N"				;Display text backwards?
        "_N"				;Display text upside-down?
        "DIMADEC"  "0"			;Angle precision
        "DIMALT"   "off"			;Alternate units
        "DIMALTD"  "0"			;Alt precision
        "DIMALTF"  "2.54"		;Alt scale factor
        "DIMALTRND"		  "0"	;Alt roundoff
        "DIMALTTD" "2"			;Alt tol precision
        "DIMALTTZ" "0"			;Alt tol zeroes
        "DIMALTU"  "2"			;Alt units
        "DIMALTZ"  "0"			;Alt zeroes
        "DIMAPOST" "cm"		;Alt prefix and suffix
        "DIMASZ"   "15/256"		;Arrow size
        "DIMATFIT" "3"			;Fit: arrow and text
        "DIMAUNIT" "0"			;Angle format
        "DIMAZIN"  "0"			;Angle zero supression
        "DIMBLK"   ""			;Arrow (ClosedFilled)
        "DIMBLK1"  ""			;Arrow 1 (ClosedFilled)
        "DIMBLK2"  ""			;Arrow 2 (ClosedFilled)
        "DIMCEN"   "23/256"		;Center mark size
        "DIMCLRD"  "6"			;Dim line color
        "DIMCLRE"  "6"			;Ext line color
        "DIMCLRT"  "7"			;Text color
        "DIMDEC"   "0"			;Precision
        "DIMDLE"   "0"			;Dim line ext
        "DIMDLI"   "97/256"		;Dim line spacing
        "DIMDSEP"  "."			;Decimal separator
        "DIMEXE"   "15/256"		;Ext line extension
        "DIMEXO"   "1/16"		;Ext line offset
        "DIMFRAC"  "2"			;Fraction format
        "DIMGAP"   "1/32"		;Text offset
        "DIMJUST"  "0"			;Text pos hor
        "DIMLDRBLK"		  ""	;Leader arrow (ClosedFilled)
        "DIMLFAC"  "1"			;Length scales a Metric dimension to Imperial  (5/127=0.3937)
        "DIMLUNIT" "4"			;Length units
        "DIMLWD"   "-2"			;Dim line LW
        "DIMLWE"   "-2"			;Ext line LW
        "DIMPOST"  "\\X"		;Text prefix and suffix
        "DIMRND"   "0"			;Roundoff
        "DIMSAH"   "Off"			;Separate arrows
        "DIMSCALE" "110"		;Overall scale
        "DIMSD1"   "Off"			;No dim line 1
        "DIMSD2"   "Off"			;No dim line 2
        "DIMSE1"   "Off"			;No ext line 1
        "DIMSE2"   "Off"			;No ext line 2
        "DIMSOXD"  "Off"		;No dim lines outside
        "DIMTAD"   "0"			;Text pos vert
        "DIMTIH"   "On"			;Text inside align
        "DIMTIX"   "Off"			;Text inside
        "DIMTMOVE" "1"			;Fit: text movement
        "DIMTOFL"  "Off"		;Dim line forced
        "DIMTOH"   "On"			;Text outside align
        "DIMTXT"   "5/64"		;Text height
        "DIMLIM"   "Off"			;Tol limits
        "DIMTDEC"  "0"			;Tol precision
        "DIMTFAC"  "1"			;Tol text scale factor
        "DIMTM"    "0"			;Tol dev lower
        "DIMTOL"   "Off"			;Tol deviation
        "DIMTOLJ"  "1"			;Tol pos vert
        "DIMTP"    "0"			;Tol dev upper
        "DIMTXSTY" "Arial"		;Text style
        "DIMTZIN"  "0"			;Tol zero suppression
        "DIMZIN"   "1"			;Zero suppression
        "_Dimstyle"  "_Save"  "Evergreen"	;Saves the dimstyle
        "_Y"				;In case the dimstyle's already there it will be overwritten, or an error will appear
        "Graphscr"			;Ensures that the routine ends in graphscreen mode
       )
      (command)
      (Command
        "_-Layer" "_T" "_0-Dim" "_M" "_0-Dim" "_C" "253" ""	"")
      (command "cmdecho" "1")
    )
    ;;;----------------------------------------------------------------------------------------
    ;;;Updates the Dimensions in the drawing.
    ;;;
    (defun c:DimUpdate ()
      (C:SetDims)  
      (command "dim" "update" "all" "")
      (command)
      (graphscr)
      (princ)
    )
    ;;;----------------------------------------------------------------------------------------
    ;;;CREATES THE _0-Dim LAYER. Allows a STRAIGHT Dimension. Then sets the 0 layer as current.
    ;;;
    (Defun C:sd ()
      (C:SetDims)
      (command "cmdecho" "0")
      (command "dimlinear" pause pause pause)
      (command "-layer" "Set" "0" "")
      (command "cmdecho" "1")
    )
    ;;;----------------------------------------------------------------------------------------
    ;;;CREATES THE _0-Dim LAYER. Allows a STRAIGHT CONTINUED Dimension. Then sets the 0 layer as current.
    ;;;
    (Defun C:dc ()
      (C:SetDims)
      (command "cmdecho" "0")
      (command "dimcontinue" pause pause pause)
      (command "-layer" "Set" "0" "")
      (command "cmdecho" "1")
    )
    ;;;----------------------------------------------------------------------------------------
    ;;;CREATES THE _0-Dim LAYER. Allows a ALIGNED Dimension. Then sets the 0 layer as current.
    ;;;
    (Defun C:da ()
      (C:SetDims)
      (command "cmdecho" "0")
      (command "dimaligned" pause pause pause)
      (command "-layer" "Set" "0" "")
      (command "cmdecho" "1")
    )
    ;;;----------------------------------------------------------------------------------------
    ;;;CREATES THE _0-Dim LAYER. Allows a RADIUS Dimension. Then sets the 0 layer as current.
    ;;;
    (Defun C:dr ()
      (C:SetDims)
      (command "cmdecho" "0")
      (command "dimradius" pause pause)
      (command "-layer" "Set" "0" "")
      (command "cmdecho" "1")
    )
    ;;;----------------------------------------------------------------------------------------
    ;;;CREATES THE _0-Dim LAYER. Allows a DIAMETER Dimension. Then sets the 0 layer as current.
    ;;;
    (Defun C:dd ()
      (C:SetDims)
      (command "cmdecho" "0")
      (command "dimdiameter" pause pause)
      (command "-layer" "Set" "0" "")
      (command "cmdecho" "1")
    )

  3. #3
    Active Member
    Join Date
    2008-05
    Posts
    58
    Login to Give a bone
    0

    Default Re: Custom Tool Buttons

    Thanks, but this is beyond me at this point. I'm talking about what you can do in the CUI files.....like create a custom button, then ^C^C_Dim or something.....can you specify the layer here or no?

  4. #4
    100 Club
    Join Date
    2008-11
    Location
    Fort Lewis, WA.
    Posts
    119
    Login to Give a bone
    0

    Default Re: Custom Tool Buttons

    Quote Originally Posted by Gary.182361 View Post
    Thanks, but this is beyond me at this point. I'm talking about what you can do in the CUI files.....like create a custom button, then ^C^C_Dim or something.....can you specify the layer here or no?
    Create a custom button then add the code below to the custom button.
    Of course, change the defpoints to what ever layer you want your dimensions on.
    This is also for a linear dimension, but this should get you started down the path.

    Code:
    ^c^c(command "_-layer" "set" "defpoints" "")(command "dimlinear" pause pause pause)

  5. #5
    Certified AUGI Addict jaberwok's Avatar
    Join Date
    2000-12
    Location
    0,0,0 The Origin
    Posts
    8,570
    Login to Give a bone
    0

    Default Re: Custom Tool Buttons

    From things that others have said, I think you should be able to put a dimension on a tool palette and have all dimensions created by using that tool appear on the same layer as the original dimension.
    Last edited by jaberwok; 2008-11-23 at 09:35 AM.

  6. #6
    I could stop if I wanted to
    Join Date
    2006-06
    Location
    Olympia, Washington, U.S.A.
    Posts
    359
    Login to Give a bone
    0

    Default Re: Custom Tool Buttons

    Quote Originally Posted by jaberwok View Post
    From things that others have said, I think you should be able to put a dimension on a tool palette and have all dimensions created by using that tool appear on the same layer as the original dimension.
    Jaberwok is correct. the process is this.

    in any drawing place a dimension from each style you would like to use. make sure the settings are set to your company standards and they are on the correct layer. then create a new tool pallet by right clicking on the tool pallet and selecting "new pallet" name it what you want.

    now drag and drop a dimension onto the tool pallet. take a look at the new dimension button it created. in newer versions you should see a flyout button with all of the dimensions available all set to the style of the one you dropped in there. rename it what you want. and do the same for the rest of your dim styles. now you don't have to worry about them being on the wrong layer.

Similar Threads

  1. 2 paint tool buttons?
    By patricks in forum Revit Architecture - General
    Replies: 2
    Last Post: 2010-11-09, 04:36 PM
  2. Custom buttons in CUI
    By bnutkins in forum AutoCAD CUI Menus
    Replies: 3
    Last Post: 2007-10-11, 02:41 PM
  3. Inserting Blocks via custom buttons
    By khorzan in forum AutoCAD Customization
    Replies: 8
    Last Post: 2006-04-17, 12:57 PM
  4. Custom Mouse buttons
    By cmason.82472 in forum AutoCAD Customization
    Replies: 10
    Last Post: 2005-06-16, 06:40 PM
  5. Custom Toolbar Buttons Changing
    By purvisp in forum AutoCAD Customization
    Replies: 2
    Last Post: 2004-10-26, 03:50 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
  •