Jump to content

lisp routine to automate coordinates


Recommended Posts

Posted

Hi, anybody who has the lisp routine that can generate drawing COORDINATES automaticaly, instead of typing ID at the command prompt & taking ID one by one. :(

 

jake

Posted

Here is a little routine to write coordinates to the drawing.

 

Very simple and no error checking, but it works for me :D

 

Load and type WC

 

;WC.LSP is a programme to write coordinates. eldon Nov 1999
(defun C:WC (/ pt0 e east eastin n north northin)
;here begins the loop that gets the actual positions
  (while (setq pt0 (getpoint "\nPick co-ordinate point:  "))
         (setq e (car pt0)        ;easting coord as number
               n (cadr pt0)       ;northing coord as number
               east (rtos e 2 3)  ;easting coord as string
               north (rtos n 2 3)  ;northing coord as string
               eastin (strcat  east "mE" )
               northin (strcat  north "mN")
         )
  (command "TEXT" pt0 "0.5" "0" eastin);size of text changed manually
  (command "TEXT" "" northin)
   )
   (princ)
)

Posted

thank you for your reply.....it really help me a lot.

Posted

hey, without LISP i can help you... in my company we use "field" command for coordinates.. we just have to create 1 field and copy copy copy to whichever or wherever you want to know the coordinates and then command the regenerate to refresh the fields.. maybe somebody here can make a code for automatic putting of fields instead of just plain text so when you move the reference point the coordinates will also change...

Posted

sorry i'm still new to LISP.. so i can't post my own codes...

Posted

ASMI, this is exactly what i'm looking for... thanks a lot.

  • 10 months later...
Posted

nice one..it really helps....big thanks ASMI

  • 1 month later...
Posted

ASMI

 

Refer to ordy.lsp could be the coordenate ID and X,Y in a table

  • 5 months later...
  • 1 month later...
Posted

hello all,

 

i am wondering if the lisp routine that eldon posted above, could be modified to select multiple points and place the x,y beside each point?? is this possible??

 

any help would be appreciated

 

Emily

Posted

Hi Emily,

 

Hows this?

 

(defun c:txtpt (/ Make_MText i ss ent)
 ; Lee Mac  ~  21.01.10

 (defun Make_MText (pt str)
   (entmakex (list (cons 0 "MTEXT")
                   (cons 100 "AcDbEntity")
                   (cons 100 "AcDbMText")  (cons 10 pt) (cons 1 str))))

 (if (setq i -1 ss (ssget '((0 . "POINT"))))
   (while (setq ent (ssname ss (setq i (1+ i))))
     (Make_MText (cdr (assoc 10 (entget ent)))
       (apply (function strcat)
         (mapcar (function strcat) '("X = " "\nY = ")
           (mapcar (function rtos) (cdr (assoc 10 (entget ent)))))))))

 (princ))

Posted
Hi Emily,

 

Hows this?

 

(defun c:txtpt (/ Make_MText i ss ent)
 ; Lee Mac  ~  21.01.10

 (defun Make_MText (pt str)
   (entmakex (list (cons 0 "MTEXT")
                   (cons 100 "AcDbEntity")
                   (cons 100 "AcDbMText")  (cons 10 pt) (cons 1 str))))

 (if (setq i -1 ss (ssget '((0 . "POINT"))))
   (while (setq ent (ssname ss (setq i (1+ i))))
     (Make_MText (cdr (assoc 10 (entget ent)))
       (apply (function strcat)
         (mapcar (function strcat) '("X = " "\nY = ")
           (mapcar (function rtos) (cdr (assoc 10 (entget ent)))))))))

 (princ))

 

 

absolutely perfect,

 

thanx so much Lee Mac exactly what i was after:D:D

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...