Discussion:
custom dimensions
(too old to reply)
jason s
2004-03-02 01:29:17 UTC
Permalink
Just wondering if anyone knows if there is a way to create a new dimension style that will automatically deduct 2" from each dimension that I draw.

I am putting lengths of pipe on a drawing and i need to put the cut length of the pipe as well as the center to center dimension. The cut length is usually 2" shorter than the center to center dimension.

I don't want to have to go in and manually change every dimension.

I'm using 2000i

Thanks in advance,

Jason
btlsp
2004-03-02 04:11:40 UTC
Permalink
See "addl" at http://www.btlsp2000.com/page9.html. You'll have to explode the dimensions.
Tom Berger
2004-03-02 08:51:18 UTC
Permalink
Post by jason s
Just wondering if anyone knows if there is a way to create a new dimension style that will automatically deduct 2" from each dimension that I draw.
This could be done with a few lines of Lisp. The dimensions can still
be associative, a reactor function can update your dimensions whenever
you modify the geometry.

Tom Berger
--
ArchTools: Architektur-Werkzeuge für AutoCAD (TM)
ArchDIM - architekturgerechte Bemaßung und Höhenkoten
ArchAREA - Flächenermittlung und Raumbuch nach DIN 277
Info und Demo unter http://www.archtools.de
James Buzbee
2004-03-02 18:27:43 UTC
Permalink
Jason,
I don't know how proficient your are with lisp but this little routine will
get you started. It takes two arguments; the first is a real number (2.0)
and the second is a dimension entity passed either through entsel or a while
loop from a selection set ( you can search for examples of using ssget and
passing each entity to the function for multiple selection.)

Hope this helps.

jb

No error checking, assumes the entity passed is a dimension that exists in
the acive document.

WFWW

;;; Use (jb:minusdim 2.0 (car(entsel "\nSelect a dimension: ")))

(defun jb:minusdim(minus dim / dimobj dist newdist newdiststr)
(vl-load-com)
(setq dimobj(vlax-ename->vla-object dim))
dist(vlax-get dimobj "Measurement"))

;adjust measurement
(setq newdist(- minus dist)
newdiststr(rtos newdist))

;set the override text
(vlax-put dimobj "TextOverride" newdiststr)
)
Ken Alexander
2004-03-02 15:41:56 UTC
Permalink
I did this using alt units and a small routine. Setting the
multiplier
small like this will make the alt unit zero.


Set a dim style to have alt units and set the following in alt
units:

Muliplier= .0000000001
Prefix= Cut Size=


(defun C:g-space (/ oc *error* dimtext)
(setq oc (getvar "cmdecho"))

(defun *error* (msg)
(if (and msg
(not (member msg
'("console break" "Function cancelled" "quit / exit abort")))
)
(princ (strcat "\nError: " msg))
)
(setvar "cmdecho" oc)
(princ)
)

(setvar "cmdecho" 0)
(if (tblobjname "dimstyle" "g-space")
(progn
(command "dimstyle" "r" "g-space")
(prompt "\nPick Dim Points:")
(command "dimlinear")
(while (= 1 (logand (getvar "cmdactive") 1))
(command pause)
)
(setq dimtext (vlax-ename->vla-object (entlast)))
(vla-put-alttextsuffix
dimtext
(strcat (rtos (- (vla-get-measurement dimtext) 3.25)) "\"")
)
)
)
(*error* nil)
(princ)
)


--
Ken Alexander
Acad2004
Windows2000 Prof.

"We can't solve problems by using the same kind
of thinking we used when we created them."
--Albert Einstein
Post by jason s
Just wondering if anyone knows if there is a way to create a new
dimension style that will automatically deduct 2" from each dimension
that I draw.
Post by jason s
I am putting lengths of pipe on a drawing and i need to put the
cut length of the pipe as well as the center to center dimension. The
cut length is usually 2" shorter than the center to center dimension.
Post by jason s
I don't want to have to go in and manually change every dimension.
I'm using 2000i
Thanks in advance,
Jason
Loading...