Hi Robert,
I'm not sure this code would help you,but for sample if you want create dimension,and look at this code to evaluated.
Code:
; smd is stand for Sample Making Dimension
; Design by : Adesu <Ade Suharna>
; Email : mteybid@yuasabattery.co.id
; Homepage : http://www.yuasa-battery.co.id
; Create : 2 August 2004
; Program no.: 45/08/2004
; Edit by : Adesu 03/08/2004 not recorded
(defun dtr (a)
(* pi (/ a 180.0))
)
(defun c:smd (/ olddimtxt olddimdec olddimtad olddimse1
olddimse2 olddimexe olddimexo olddimgap
olddimtih p1 p2 p3 p4 ent3 ent4)
(setq oldosmode (getvar "osmode")) ; get osmode setting
(setvar "osmode" 0) ; osmode set to 0
(setq oldcmdecho (getvar "cmdecho")) ; get cmdecho setting
(setvar "cmdecho" 0) ; cmdecho set to 0
(vl-load-com)
(setq olddimtxt (getvar "dimtxt")
olddimdec (getvar "dimdec")
olddimtad (getvar "dimtad")
olddimse1 (getvar "dimse1")
olddimse2 (getvar "dimse2")
olddimexe (getvar "dimexe")
olddimexo (getvar "dimexo")
olddimgap (getvar "dimgap")
olddimtih (getvar "dimtih")
oldfilletrad (getvar "filletrad")
olddimblk (getvar "dimblk")
olddimasz (getvar "dimasz")
olddimlim (getvar "dimlim")
olddimtm (getvar "dimtm")
olddimtol (getvar "dimtol")
olddimtdec (getvar "dimtdec"))
(setvar "dimtxt" 1) ; set text height
(setvar "dimdec" 2) ; set decimal presicion
(setvar "dimtad" 1) ; set vertical position
(setvar "dimse1" 0) ; set Suppresses display of the first extension line
(setvar "dimse2" 0) ; set Suppresses display of the second extension line
(setvar "dimexe" 1) ; set Specifies how far to extend the extension line beyond the dimension line
(setvar "dimexo" 1) ; set Specifies how far extension lines are offset from origin points
(setvar "dimgap" 1) ; set Sets the distance around the dimension text when the dimension line breaks to accommodate dimension text
(setvar "dimtih" 0) ; set Controls the position of dimension text inside the extension lines for all dimension types except ordinate
(setvar "filletrad" 3) ; set radius of follet
(setvar "dimblk" "_open") ; set style arrow
(setvar "dimasz" 1) ; set arrow size
(setvar "dimlim" 1) ; set limit
(setvar "dimtm" 5) ; set lower limit
(setvar "dimtol" 1) ; set limit
(setvar "dimtdec" 0) ; set limit presicion
(setq p1 (list 0 0)
p2 (list 10 0)
p3 (list 10 15)
p4 (list 0 15))
(command "_line" p1 p2 p3 p4 "c" "")
(setq ent3 (list 15 15)
ent4 (list 7.5 20)
ent5 (polar p1 (dtr 0) 5)
ent6 (polar p1 (dtr 90) 5)
ent7 (polar p1 (dtr 0) 3)
ent7a (polar ent7 (dtr 90) 3)
ent8 (polar ent7a (dtr 225) 3)
ent9 (polar ent7a (dtr 225) 10))
(command "_dimlinear" p2 p3 "v" ent3 "")
(command "_dimlinear" p4 p3 "h" ent4 "")
(command "_fillet" ent5 ent6 "")
(command "_dimradius" ent8 ent9 "")
(setvar "osmode" oldosmode) ; return setting
(setvar "cmdecho" oldcmdecho)
(setvar "dimtxt" olddimtxt)
(setvar "dimdec" olddimdec)
(setvar "dimtad" olddimtad)
(setvar "dimse1" olddimse1)
(setvar "dimse2" olddimse2)
(setvar "dimexe" olddimexe)
(setvar "dimexo" olddimexo)
(setvar "dimgap" olddimgap)
(setvar "dimtih" olddimtih)
(setvar "dimblk" olddimblk)
(setvar "dimasz" olddimasz)
(setvar "dimlim" olddimlim)
(setvar "dimtm" olddimtm)
(setvar "dimtol" olddimtm)
(setvar "dimtdec" olddimtdec)
(princ)
(command "_redraw")
)
Originally Posted by
Robert.Hall
Does anyone have a lisp routine that will change the units of a dimension
from metric to english units while converting the specified tolerance?
I can use dimension styles, however, switching between them results
in a lost tolerance. See example:
I have 100+/-2
changing the dimstyle I get
3.93 without a tolerance.
Is it possible to get 3.93 +/-0.08?
Are there too many variables that the routine would have to manipulate?