Welcome to Tech Support Forum home to more then 136,000 problems solved. Issues have included: Spyware, Malware, Virus Issues, Windows, Microsoft, Linux, Networking, Security, Hardware, and Gaming Getting your problem solved is as easy as:
1. Registering for a free account
2. Asking your question
3. Receiving an answer

Registered members:
* Get free support
* Communicate privately with other members (PM).
* Removal of this message
* See fewer ads.
* And much more..

 



Want to know how to post a question? click here Having problems with spyware and pop-ups? First Steps
Go Back   Tech Support Forum > The IT Pro > Programming
User Name
Password
Site Map Register Donate Rules Blogs Mark Forums Read


Programming A discussion forum for programs and programming used in tech-related businesses.

Reply
 
LinkBack Thread Tools
Old 02-06-2007, 04:00 PM   #1 (permalink)
Registered User
 
Join Date: Feb 2007
Posts: 1
OS: WinXP


AutoLisp program

I need an AutoLisp program that finds the nodes of a grid (x,y) and shows the coordinates (x,y).
georges is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Important Information
Join the #1 Tech Support Forum Today - It's Totally Free!

TechSupportForum.com is a leading support website for your computer needs. We offer free, friendly and personalized computer support. Why pay to have your computer fixed when you can do it for free.

Join TechSupportforum.com Today - Click Here

Old 06-19-2009, 03:37 AM   #2 (permalink)
Registered User
 
Join Date: Jun 2009
Posts: 1
OS: xp


Re: AutoLisp program

Quote:
Originally Posted by georges View Post
I need an AutoLisp program that finds the nodes of a grid (x,y) and shows the coordinates (x,y).
hi buddy


copy and paste this prog in notepad and saveas les.lsp

N load in to acad and enjoy



;|LEC.Lsp
Draws automatic leaders with the coordinates of the picked point
Either X & Y (2) or X, Y, & Z (3) coordinates.

Note: Don't forget to change lines 36-40 to your custom settings.

(setq RM 2)
(setq RP 0) ; RP = rtos precision (amount of decimal places)
(setq IN "N") ; IN = in units that show inches <RP = 3 or 4>, do you want the inches to be removed?
(setq FT "N") ; FT = in decimal units <RP = 2>, do you want to show a "'" <foot> mark?
(setq DV "N") ; DV = do you want to divide by 12?
;------------------------------------------------------------------------

(defun C:LEC ()
(setvar "cmdecho" 0)
(command "._undo" "be")
(setq #ORMOD (getvar "orthomode"))
(setvar "orthomode" 0)
(cond
((= RM 1)(princ "\nRoutine is formatted for Scientific Units."))
((= RM 2)(princ "\nRoutine is formatted for Decimal Units."))
((= RM 3)(princ "\nRoutine is formatted for Engineering Units."))
((= RM 4)(princ "\nRoutine is formatted for Architectural Units."))
((= RM 5)(princ "\nRoutine is formatted for Fractional Units."))
(T
(progn
(princ "\nUnits is not set correctly. Check Lisp routine for incorrect unit value. \nExiting Routine.")
(exit)
)
)
)
(initget "2 3")
(if (= 2OR3 nil)
(progn
(setq 2OR3 (getkword "\nHow many coordinates? (2 or 3) <2>: "))
(if (= 2OR3 nil)(setq 2OR3 "2"))
)
(progn
(setq 2OR3o 2OR3)
(setq 2OR3 (getkword (strcat "\nHow many coordinates? (2 or 3) <" 2OR3 ">: ")))
(if (= 2OR3 nil)(setq 2OR3 2OR3o))
)
)
(setq STPT (getpoint "\nPick Station Point: "))
(if (= (strcase DV) "N")
(progn
(setq STT1 (rtos (car STPT) RM RP))
(setq STT2 (rtos (cadr STPT) RM RP))
(setq STT3 (rtos (caddr STPT) RM RP))
)
(progn
(setq STT1 (rtos (/ (car STPT) 12) RM RP))
(setq STT2 (rtos (/ (cadr STPT) 12) RM RP))
(setq STT3 (rtos (/ (caddr STPT) 12) RM RP))
)
)
(if (and (or (= RP 3)(= RP 4))(= (strcase IN) "Y"))
(progn
(setq STT1 (substr STT1 1 (1- (strlen STT1))))
(setq STT2 (substr STT2 1 (1- (strlen STT2))))
(setq STT3 (substr STT3 1 (1- (strlen STT3))))
)
)
(if (= (strcase FT) "Y")
(progn
(if (= 2OR3 "2")
(setq STTX (strcat STT1 "', " STT2 "'"))
(setq STTX (strcat STT1 "', " STT2 "', " STT3 "'"))
)
)
(progn
(if (= 2OR3 "2")
(setq STTX (strcat STT1 ", " STT2))
(setq STTX (strcat STT1 ", " STT2 ", " STT3))
)
)
)
(princ "\nPick End of leader...")
(command "._leader" STPT pause "" STTX "")
(princ "done!")
(setvar "orthomode" #ORMOD)
(command "._undo" "e")
(setvar "cmdecho" 1)
(princ)
)
(prompt "\n(c) Copyright TIPPIT 1999
\nType LEC to run.\tVersion 1.6 ")
(princ)

Last edited by srig; 06-19-2009 at 03:39 AM.
srig is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Reply


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




All times are GMT -7. The time now is 06:49 AM.



Copyright 2001 - 2009, Tech Support Forum
Home Tips Plus | Outdoor Basecamp | Automotive Support Forum

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85