Nmaks Posted December 24, 2013 Posted December 24, 2013 (edited) 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: You must now save the file Cr.LSP file extension Loading the lisp file Next, open AutoCAD and select ToolsAutoLISPLoad... from the pull-down menu. You will see the dialogue box shown below 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 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 December 24, 2013 by Nmaks Quote
ReMark Posted December 24, 2013 Posted December 24, 2013 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. Quote
Nmaks Posted December 24, 2013 Author Posted December 24, 2013 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 Quote
eldon Posted December 24, 2013 Posted December 24, 2013 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. Quote
ReMark Posted December 24, 2013 Posted December 24, 2013 I'm assuming this is where one would change the number of decimal places shown? (setq STDX (rtos P1X 2 3)) (setq STDY (rtos P1Y 2 3)) Quote
Organic Posted December 25, 2013 Posted December 25, 2013 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. Quote
Recommended Posts
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.