Jump to content
robwell

X-Y Dimensions

Recommended Posts

robwell

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 this post


Link to post
Share on other sites
BIGAL

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 this post


Link to post
Share on other sites
robwell

If only I knew how to write lisp codes.

Share this post


Link to post
Share on other sites
Dahzee

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)
             ly (cons (cadr l1) ly)
             rx (cons (car r1) rx)
             ry (cons (cadr r1) ry)
       )
     )
     (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)
)
(vl-load-com)

Share this post


Link to post
Share on other sites
robwell

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 this post


Link to post
Share on other sites
CyberAngel
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 this post


Link to post
Share on other sites
robwell

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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×