Jump to content

X-Y Dimensions


robwell

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

Link to comment
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

Link to comment
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)
             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)

Link to comment
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.

Link to comment
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)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...