# X-Y Dimensions

## Recommended Posts

Is there a way to dimension the x-y lengths between two points at the same time without have to do a linear dimension each time?

I don't wan't coordinates. I am looking for lengths.

Maybe a lisp or a macro?

Thanks

##### Share on other sites

Simplest way is a dimension style you can turn off lots of stuff so could just have a style which is the arrows but it would use the dim align command but a little lisp would fix that.

Good one to have a go at yourself. In words pick pt1, pick pt2, command dim align pt1 pt2 all done

##### Share on other sites

If only I knew how to write lisp codes.

##### Share on other sites

Robwell,

This will dimension x and y of a selection, not sure if it is what you need.

Tharwat kindly wrote this so make sure you don't remove his name.

```(defun c:kk (/ s i l r l1 r1 lx ly rx ry a b c d p1 p2 p3)
;;    Tharwat 28. Nov. 2013         ;;
(if (setq s (ssget '((-4 . "<NOT")
(-4 . "<OR")
(0 . "XLINE")
(0 . "RAY")
(0 . "*DIMENSION")
(-4 . "OR>")
(-4 . "NOT>")
)
)
)
(progn
(repeat (setq i (sslength s))
(vla-GetBoundingBox
(vlax-ename->vla-object (ssname s (setq i (1- i))))
'l
'r
)
(setq l1 (vlax-safearray->list l)
r1 (vlax-safearray->list r)
lx (cons (car l1) lx)
rx (cons (car r1) rx)
)
)
(setq a  (apply 'min lx)
b  (apply 'min ly)
c  (apply 'max rx)
d  (apply 'max ry)
p1 (list c d)
p2 (list a d)
p3 (list c b)
)
(command "._dimlinear"
"_none"
p1
"_none"
p2
"_none"
(polar p1 (* pi 0.5) (/ (distance p1 p2) 10.))
)
(command "._dimlinear"
"_none"
p1
"_none"
p3
"_none"
(polar p1 0. (/ (distance p1 p3) 10.))
)
)
)
(princ)
)

##### Share on other sites

This works perfectly. I was able to manipulate a couple numbers to make the offset a little further out. The only thing I wish I knew how to do would be to put the dims on the opposite sides in which they are placed with this lisp. I can still definitely use it though. Thank you.

If anyone knows how to manipulate the location placement of the dims, that would be awesome.

Thanks again, Dahzee.

##### Share on other sites
If anyone knows how to manipulate the location placement of the dims, that would be awesome.

If I understand what you want and what the code says, you can move the origin to the other side of the selection box. In other words, the line

p1 (list c d)

becomes

p1 (list a b)

##### Share on other sites

That's the right direction CyberAngel, thanks. It doesn't place them exactly as I like, so I will work with that to find the right placement.