![]() |
![]() |
![]() |
|||||
![]() |
![]() |
![]() |
![]() |
![]() |
|||
| 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: * 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 |
|
|||||||
| Programming A discussion forum for programs and programming used in tech-related businesses. |
![]() |
|
|
LinkBack | Thread Tools |
|
|
#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).
|
|
|
|
| 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 |
|
|
#2 (permalink) | |
|
Registered User
Join Date: Jun 2009
Posts: 1
OS: xp
|
Re: AutoLisp program
Quote:
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. |
|
|
|
|
![]() |
| Thread Tools | |
|
|