Lisp routine for coordinate dimensions

Lisp routine for coordinate dimensions

Anonymous
Not applicable
2,353 Views
9 Replies
Message 1 of 10

Lisp routine for coordinate dimensions

Anonymous
Not applicable

Hi,

Does anyone have a lisp routine that will globally dimension a series of coordinates similar to how they are shown in the enclosed attachment ?

thanks

Mark

0 Likes
Accepted solutions (2)
2,354 Views
9 Replies
Replies (9)
Message 2 of 10

Ranjit_Singh
Advisor
Advisor

A quick example

(defun c:somefunc  (/ pt)
 (while (setq pt (getpoint "\nSelect Ordinate point:"))
  (command "._dimordinate" pt (mapcar '- pt '(2 0 0)) "._dimordinate" pt (mapcar '- pt '(0 2 0)))))

Ord_Dimension.gif

 

Message 3 of 10

braudpat
Mentor
Mentor

 

Hello Ranjit

 

Your routine is so beautiful, so compact, so AutoLisp !

 

Thanks, Regards, Patrice

 

Patrice ( Supporting Troops ) - Autodesk Expert Elite
If you are happy with my answer please mark "Accept as Solution" and if very happy please give me a Kudos (Felicitations) - Thanks

Patrice BRAUD

EESignature


0 Likes
Message 4 of 10

Anonymous
Not applicable

HI Ranjit, great lisp file, but when I try to pick a point using an osnap such as intersection, it only gives me one coordinate. When I pick a floating area as per your screen shot it will give me both X & Y

 

 

0 Likes
Message 5 of 10

Ranjit_Singh
Advisor
Advisor

braudpat wrote:

Hello Ranjit

Your routine is so beautiful, so compact, so AutoLisp !

Thanks, Regards, Patrice


 Thanks @braudpat


@Anonymous wrote:

HI Ranjit, great lisp file, but when I try to pick a point using an osnap such as intersection, it only gives me one coordinate. When I pick a floating area as per your screen shot it will give me both X & Y


Can you provide some demonstration or more details. I am not able to replicate the problem. It works even with osnap for me.

Osnap_ordinate_dim.gif

0 Likes
Message 6 of 10

ВeekeeCZ
Consultant
Consultant

Isn't it just the osnap issue?

 

(defun c:somefunc  (/ pt)
 (while (setq pt (getpoint "\nSelect Ordinate point:"))
  (command "._dimordinate" "_non" pt  "_non" (mapcar '- pt '(2 0 0))
           "._dimordinate" "_non" pt "_non" (mapcar '- pt '(0 2 0)))))
0 Likes
Message 7 of 10

Ranjit_Singh
Advisor
Advisor

@ВeekeeCZ wrote:

Isn't it just the osnap issue?

 ................


I honestly don't think so. Seems like OP wants to use osnap, and when he does he just gets one of the ordinate dimensions. That doesn't make sense to me.

0 Likes
Message 8 of 10

Anonymous
Not applicable

HI,

so I tried reloading the lisp file and now it does work with Osnaps. No sure why it didn't the first time. One other question and then I'm set. If I want the X coordinate to show on the right instead of left, is that adjusted in the dimension settings ?

thanks

 

0 Likes
Message 9 of 10

Ranjit_Singh
Advisor
Advisor
Accepted solution

Yes, something like this to flip the x-corodinate

(defun c:somefunc  (/ pt)
 (while (setq pt (getpoint "\nSelect Ordinate point:"))
  (command "._dimordinate" pt (mapcar '+ pt '(2 0 0)) "._dimordinate" pt (mapcar '- pt '(0 2 0)))));+- option

and this to flip y

(defun c:somefunc  (/ pt)
 (while (setq pt (getpoint "\nSelect Ordinate point:"))
  (command "._dimordinate" pt (mapcar '- pt '(2 0 0)) "._dimordinate" pt (mapcar '+ pt '(0 2 0)))));-+ operation

Really there could be four different combinations; ++ (NE Quadrant) +-(NW Quadrant) -+(SE Quadrant) -- (SW Quadrant)

 

0 Likes
Message 10 of 10

Anonymous
Not applicable
Accepted solution

PERFECT !!!

Thanks again for your help

0 Likes