PDA

View Full Version : Looking for Lisp on Dim Styles



BCrouse
2013-07-01, 06:03 PM
Hello all, it has been awhile since I have been on here and forget a lot of stuff. I am looking for a lisp that will give you a dialog box that will allow you to add a dimension after you select the dimension scale and text scale The name of the text style is called Dimtxt and and the font style is simplex. The layer is A-Anno-Dims withe color is 30. So basically you can select that scale factor and everything is automatically set for that scale up select.



Thank you,

Brad

Tom Beauford
2013-07-01, 08:13 PM
Why the dimension scale? Is the drawing not drawn actual size? Since the layer is A-Anno-Dims why not use an Annotative Dimension Style?

BCrouse
2013-07-01, 11:48 PM
I haven't been using AutoCAD since 2009. I am using ADT 2007 and I am not up to speed with new improvements to the software. The reason for dim scale is for vport so i can have different scales in Model Space.

tedg
2013-07-02, 01:15 PM
I haven't been using AutoCAD since 2009. I am using ADT 2007 and I am not up to speed with new improvements to the software. The reason for dim scale is for vport so i can have different scales in Model Space.

Ok here's a quick, crude routine that will get you started, (I know it's not what you asked for but)..
This doesn't have a dialog box, but simply follow the command prompt, (it only asks you one question).

It simply asks for your desired "dimscale" and so you type the number and creates the a dimstyle name of "DIM-XX"
So if you were doing a scaled viewport of 1/4" = 1'-0" you would type 48 when asked, and it would create the dimstyle "DIM-48" and set it current.

This creates the "A-ANNO-DIMS" layer and sets it current, and creates the text style "Dimtxt" and the dimstyle based on your provided dimscale.
You will need to adjust dimension style variables and text style variables to meet your needs, these are ones I use



(defun c:mdim (/ dimsc dpref)
(setq dpref "DIM-")
(setvar "dimtad" 1)
(setvar "dimtoh" 0)
(setvar "dimtih" 0)
(setvar "dimtad" 1)
(setvar "dimasz" 0.125)
(setvar "dimtofl" 1)
(setvar "dimtmove" 2)
(setvar "dimfrac" 2)
(setvar "dimlunit" 4)
(setvar "dimtxt" 0.125)
(setvar "dimzin" 3)
(setq dimsc (getstring (prompt"Dimscale?")))
(if (= (tblsearch "layer" "A-ANNO-DIMS")
nil)
(command "-layer" "make" "A-ANNO-DIMS" "color" "30" "" "lw" "0.25" "" "lt" "continuous" "" ""))
(if (= (tblsearch "style" "Dimtxt")
nil)
(command "-style" "Dimtxt" "Simplex.shx" "0" "0.8" "0" "n" "n" "n" ""))
(command "-layer" "set" "A-ANNO-DIMS" "")
(command "dim" "scale" dimsc "" "style" "Dimtxt" "" "" "exit")
(command "-dimstyle" "S" (strcat dpref dimsc) "")
(princ)
)

Hope this helps...