Jump to content

How to make Coordinate LSP and Use ?


Nmaks

Recommended Posts

How to make Coordinate LSP and Use ?

 

Creating the Coordinate lisp file

 

Copy and paste all of the text in the Code: box into Windows Notepad. Take care not to miss anything out. Below is an example:

 

;cord-ldr.lsp
; x,y Coordinates on Leader Lines
;cord-ldr.lsp
; x,y Coordinates on Leader Lines

(defun C:CR (/ PNT1 P1X P1Y STDY DY PTXT )
   (setq PNT1 (getpoint "\nPick coordinate point: "))
   (setq P1X (car pnt1)) ;x coord
   (setq P1Y (cadr pnt1)) ;y coord
   (setq STDX (rtos P1X 2 3))
   (setq STDY (rtos P1Y 2 3))
   ;(setq COORD (strcat "E=" STDX "\nN=" STDY))
   (setq PTXT (getpoint "\nPick text location: "))
   (command "leader" PNT1 PTXT "" (strcat "E=" STDX)
     (strcat "N=" STDY) "")
   (princ)) ; end        
(DEFUN) C:ZZ () (COMMAND "ZOOM" "P"))

When you have pasted the code into Notepad, you should have something like this:

 

to4m.jpg

 

You must now save the file Cr.LSP file extension

 

Loading the lisp file

 

Next, open AutoCAD and select Toolssubmenu.gifAutoLISPsubmenu.gifLoad... from the pull-down menu. You will see the dialogue box shown below

 

2.jpg

 

Use the following sequence to load Cr.lsp:

 

1. Navigate to the folder where you saved the lisp file.

2. Select the file you want from the list.

3. Click the Load button.

If all went well, you will see a message saying "Cr.lsp successfully loaded".

4. Click the Close button to close the dialogue box.

 

 

How to Use

 

4.jpg

 

1.Command: cr enter

 

2.Then Pick coordinate point

 

3.Pick text location:

 

(You need to click twice: the point you want to label and label location.)

 

Coordinate Lisp >>> press here >>> Cr.lsp

 

 

This is My 1st thread ...

 

Thanks You Nmaks

Edited by Nmaks
Link to comment
Share on other sites

Don't most similar lisp routines list the north coordinate first?

 

Lisp files can be uploaded to CADTutor directly. File size is limited to 250KB.

Link to comment
Share on other sites

Don't most similar lisp routines list the north coordinate first?

 

Lisp files can be uploaded to CADTutor directly. File size is limited to 250KB.

 

 

Lisp file uploaded

Link to comment
Share on other sites

Don't most similar lisp routines list the north coordinate first?

 

It depends on the local usage. With a routine such as this, changing the order of coordinates should give a useful start to learning lisp.

Link to comment
Share on other sites

Don't most similar lisp routines list the north coordinate first?

 

Lisp files can be uploaded to CADTutor directly. File size is limited to 250KB.

 

Not in my experience. It is always Easting (i.e. the x coordinate), followed by Northing (i.e. the y coordinate). It may be different in the US though.

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