Using aliases

Does anyone know if there's an easy way to create aliases for more than one command. For example, I want to create an alias 'ZA' that will ZOOM then
ALL. The PGP file only allows one command aliases. Can this only be done in LISP and if so, does anyone have some sample code?
Any help appreciated.
Add pictures here
✖
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
LISP will do that:
(defun c:za (/)(command "zoom" "a"))
Of course, you have to load it first.
--


MichaelB
www.michaelbulatovich.com
  Click to see the full signature.
Add pictures here
✖
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
This is autoloaded on startup ... email me for a zipped copy if desired...
;; *********************************************************************** ;; * * ;; * ZOOMCUT.lsp written by Chip Harper 08-07-02 * ;; * Edited to add ZL command on 08-26-02 * ;; * Edited to turn off cmdecho on 03-25-03 * ;; * Edited ZL point variable names on 03-25-03 * ;; * Edited CCME to match standards on 05-11-03 * ;; * * ;; * Email: snipped-for-privacy@hotmail.com * ;; * * ;; * Homepage: * ;; * * ;; * Program establishes 2 letter shortcuts for zoom commands * ;; * zoom extents = ZE * ;; * zoom window = ZW * ;; * zoom previous = ZP * ;; * zoom all = ZA * ;; * zoom center = ZC * ;; * zoom dynamic = ZD * ;; * zoom scale = ZS * ;; * zoom limits = ZL * ;; * * ;; * Notes: Zoom Limits is not a "Native" command; Basicly it is a zoom * ;; * window using drawing limits as pick points. Limits need to * ;; * be set prior to using the command, as it will not prompt for * ;; * points. * ;; * * ;; * Because of the simple nature of the programs * ;; * no Error Handler is needed or provided. * ;; * * ;; * This program is "Autoloaded" with AutoCAD on my machine * ;; * via the profile.mnl file located in the custom directory. * ;; * * ;; * * ;; * This lisp is FREEWARE, you may distribute, copy, edit and/or modify * ;; * this program as you see fit. * ;; * * ;; *********************************************************************** ;; ;; **************************************** ;; * == Error Handler == * ;; * * ;; **************************************** ;; ;; none ;; ;; ;; **************************************** ;; * == Main Function == * ;; * * ;; **************************************** ;; (defun C:ZE () ; Zoom Extents (setq CCME (getvar "cmdecho")) ; Get cmdecho setting (setvar "cmdecho" 0) ; Turn off cmdecho (command "_.ZOOM" "_E") (setvar "cmdecho" CCME) ; Reset cmdecho (princ) ) ; End C:ZE.
(defun C:ZW () ; Zoom Window (setq CCME (getvar "cmdecho")) ; Get cmdecho setting (setvar "cmdecho" 0) ; Turn off cmdecho (command "_.ZOOM" "_W") (setvar "cmdecho" CCME) ; Reset cmdecho (princ) ) ; End C:ZW
(defun C:ZP () ; Zoom Previous (setq CCME (getvar "cmdecho")) ; Get cmdecho setting (setvar "cmdecho" 0) ; Turn off cmdecho (command "_.zoom" "_P") (setvar "cmdecho" CCME) ; Reset cmdecho (princ) ) ; End C:ZP
(defun C:ZA () ; Zoom All (setq CCME (getvar "cmdecho")) ; Get cmdecho setting (setvar "cmdecho" 0) ; Turn off cmdecho (command "_.zoom" "_A") (setvar "cmdecho" CCME) ; Reset cmdecho (princ) ) ; End C:ZA
(defun C:ZC () ; Zoom Center (setq CCME (getvar "cmdecho")) ; Get cmdecho setting (setvar "cmdecho" 0) ; Turn off cmdecho (command "_.zoom" "_C") (setvar "cmdecho" CCME) ; Reset cmdecho (princ) ) ; End C:ZC
(defun C:ZD () ; Zoom Dynamic (setq CCME (getvar "cmdecho")) ; Get cmdecho setting (setvar "cmdecho" 0) ; Turn off cmdecho (command "_.zoom" "_D") (setvar "cmdecho" CCME) ; Reset cmdecho (princ) ) ; End C:ZD
(defun C:ZS () ; Zoom Scale (setq CCME (getvar "cmdecho")) ; Get cmdecho setting (setvar "cmdecho" 0) ; Turn off cmdecho (command "_.zoom" "_S") (setvar "cmdecho" CCME) ; Reset cmdecho (princ) ) ; End C:ZS
(defun c:ZL ( / ZLPT1 ZLPT2) ; Zoom Limits (setq CCME (getvar "cmdecho")) ; Get cmdecho setting (setvar "cmdecho" 0) ; Turn off cmdecho (setq ZLPT1 (getvar "limmin")) (setq ZLPT2 (getvar "limmax")) (command "_.zoom" "window" ZLPT1 ZLPT2) (setvar "cmdecho" CCME) ; Reset cmdecho (princ) ) ; End C:ZL
(princ) ;; ;; **************************************** ;; * == Load Message == * ;; * * ;; **************************************** ;; (prompt "\n ZoomCut.lsp Loaded") (prompt "\n Written by Chip Harper") (prompt "\n ") ;; ;; **************************************** ;; * == End of File == * ;; * * ;; **************************************** ;;
--

Chip Harper

http://home.comcast.net/~hot4cad /
  Click to see the full signature.
Add pictures here
✖
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
try this http://www.freecadapps.com/swdetails.php?page=search&review%27&rowcolor üe08d

one
Add pictures here
✖
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
Dave
I have another option that uses an accelerators all that is needed is that in an MNS file that is loaded add the following
***ACCELERATORS [CONTROL+"F1"] 'zoom Dynamic [CONTROL+"F2"] 'zoom window [CONTROL+"F3"] 'zoom all
What This does is with the Control key held down then press the F1 and the zoom dynamic is started.
Only 2 keys are pressed not 3( Z E Enter) Think of it, If you use the zoom window alot, lets say 100 times a day or more that is 100+ less key strokes to be made, and like the ZE Control and F1-F5 all reachable with just the right hand.
I have also set up accelerators for all the OSnaps using the Shift and a FunctionKey
Half my office work group uses these.

one
Add pictures here
✖
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
(Disco Dave) wrote:

Here is a whole series of simple aliases. Put them in your Acad Support directory and then add them to the acad.lsp start-up file. They will then always be loaded.
This one is called "Jkeys".
(princ "\n ...Loading Jkeys!...\n")
;Sub-routines used in Jkeys (Defun Eon () (setvar "cmdecho" 1) );Eon
(Defun Eof () (setvar "cmdecho" 0) );Eof
(EOF)
(DEFUN C:A () (COMMAND "REDRAW")) (DEFUN C:AC () (COMMAND "ARC")) (DEFUN C:AP (/ obj) (princ "\nPolar Array:") (setq obj (ssget)) (COMMAND "ARRAY" obj "" "P")) (DEFUN C:AR (/ obj) (princ "\nRectangular Array:") (setq obj (ssget)) (COMMAND "ARRAY" obj "" "R")) (DEFUN C:AU () (COMMAND "SETVAR" "AUPREC")) (DEFUN C:BL () (COMMAND "BLOCK")) (DEFUN C:BP () (SETVAR "OSMODE" 32) (COMMAND "BREAK" PAUSE "F" PAUSE "@") (SETVAR "OSMODE" 0)) (DEFUN C:BS () (SETVAR "OSMODE" 32)(MENUCMD "S=BREAK") (COMMAND "BREAK" PAUSE "F")(SETVAR "OSMODE" 0)) (DEFUN C:C () (COMMAND "CIRCLE"))
;change layer colors (DEFUN C:CCB (/ jset) (princ "\nChange color to Blue") (setq jset (ssget)) (COMMAND "CHPROP" jset "" "CO" "BLUE" "") (setq jset nil)) (DEFUN C:CCBY (/ jset) (princ "\nChange color to Bylayer") (setq jset (ssget)) (COMMAND "CHPROP" jset "" "CO" "BYLAYER" "") (setq jset nil)) (DEFUN C:CCC (/ jset) (princ "\nChange color to Cyan") (setq jset (ssget)) (COMMAND "CHPROP" jset "" "CO" "CYAN" "") (setq jset nil)) (DEFUN C:CCG (/ jset) (princ "\nChange color to Green") (setq jset (ssget)) (COMMAND "CHPROP" jset "" "CO" "GREEN" "") (setq jset nil)) (DEFUN C:CCM (/ jset) (princ "\nChange color to Magenta") (setq jset (ssget)) (COMMAND "CHPROP" jset "" "CO" "MAGENTA" "") (setq jset nil)) (DEFUN C:CCR (/ jset) (princ "\nChange color to Red") (setq jset (ssget)) (COMMAND "CHPROP" jset "" "CO" "RED" "") (setq jset nil)) (DEFUN C:CCW (/ jset) (princ "\nChange color to White") (setq jset (ssget)) (COMMAND "CHPROP" jset "" "CO" "WHITE" "") (setq jset nil)) (DEFUN C:CCY (/ jset) (princ "\nChange color to Yellow") (setq jset (ssget)) (COMMAND "CHPROP" jset "" "CO" "YELLOW" "") (setq jset nil)) (DEFUN C:CC8 (/ jset) (princ "\nChange to color 8") (setq jset (ssget)) (COMMAND "CHPROP" jset "" "CO" "8" "") (setq jset nil)) (DEFUN C:CC9 (/ jset) (princ "\nChange to color 9") (setq jset (ssget)) (COMMAND "CHPROP" jset "" "CO" "9" "") (setq jset nil)) (DEFUN C:CC10 (/ jset) (princ "\nChange to color 10") (setq jset (ssget)) (COMMAND "CHPROP" jset "" "CO" "10" "") (setq jset nil)) (DEFUN C:CC11 (/ jset) (princ "\nChange to color 11") (setq jset (ssget)) (COMMAND "CHPROP" jset "" "CO" "11" "") (setq jset nil)) (DEFUN C:CC12 (/ jset) (princ "\nChange to color 12") (setq jset (ssget)) (COMMAND "CHPROP" jset "" "CO" "12" "") (setq jset nil)) (DEFUN C:CC13 (/ jset) (princ "\nChange to color 13") (setq jset (ssget)) (COMMAND "CHPROP" jset "" "CO" "13" "") (setq jset nil)) (DEFUN C:CC14 (/ jset) (princ "\nChange to color 14") (setq jset (ssget)) (COMMAND "CHPROP" jset "" "CO" "14" "") (setq jset nil)) (DEFUN C:CC15 (/ jset) (princ "\nChange to color 15") (setq jset (ssget)) (COMMAND "CHPROP" jset "" "CO" "15" "") (setq jset nil))
(DEFUN C:CF () (EON)(COMMAND "CHAMFER" "D" PAUSE "" "CHAMFER") (EOF))
(DEFUN C:CH () (MENUCMD "S=CHANGE") (COMMAND "CHANGE" "AUTO"))
;change layers (DEFUN C:CLA (/ jset) (eof) (princ "\nChange objects to another layer... ") (setq jset (ssget)) (COMMAND "CHPROP" jset "" "LA" ) (setq jset nil)) (DEFUN C:CLB (/ jset) (princ "\nChange to layer BLANK") (setq jset (ssget)) (COMMAND "CHPROP" jset "" "LA" "BLANK" "") (setq jset nil)) (DEFUN C:CLC (/ jset) (princ "\nChange to layer CENTER") (setq jset (ssget)) (COMMAND "CHPROP" jset "" "LA" "CENTER" "") (setq jset nil)) (DEFUN C:CLD (/ jset) (princ "\nChange to layer DIMENSION") (setq jset (ssget)) (COMMAND "CHPROP" jset "" "LA" "DIMENSION" "") (setq jset nil)) (DEFUN C:CLH (/ jset) (princ "\nChange to layer HIDDEN") (setq jset (ssget)) (COMMAND "CHPROP" jset "" "LA" "HIDDEN" "") (setq jset nil)) (DEFUN C:CLHH (/ jset) (princ "\nChange to layer HATCH") (setq jset (ssget)) (COMMAND "CHPROP" jset "" "LA" "HATCH" "") (setq jset nil)) (DEFUN C:CLO (/ jset) (princ "\nChange to layer OBJECT") (setq jset (ssget)) (COMMAND "CHPROP" jset "" "LA" "OBJECT" "") (setq jset nil)) (DEFUN C:CLP (/ jset) (princ "\nChange to layer PHANTOM") (setq jset (ssget)) (COMMAND "CHPROP" jset "" "LA" "PHANTOM" "") (setq jset nil)) (DEFUN C:CL0 (/ jset) (princ "\nChange to layer 0") (setq jset (ssget)) (COMMAND "CHPROP" jset "" "LA" "0" "") (setq jset nil))
(DEFUN C:CP () (COMMAND "CHPROP"))
;change line types (DEFUN C:CT () (COMMAND "CHPROP" PAUSE PAUSE "LT")) (DEFUN C:CTC (/ jset) (princ "\nChange to Centerline") (setq jset (ssget)) (COMMAND "CHPROP" jset "" "LT" "CENTER" "") (setq jset nil)) (DEFUN C:CTH (/ jset) (princ "\nChange to Hidden line") (setq jset (ssget)) (COMMAND "CHPROP" jset "" "LT" "HIDDEN" "") (setq jset nil)) (DEFUN C:CTO (/ jset) (princ "\nChange to Object line") (setq jset (ssget)) (COMMAND "CHPROP" jset "" "LT" "CONTINUOUS" "") (setq jset nil)) (DEFUN C:CTP (/ jset) (princ "\nChange to Phantom line") (setq jset (ssget)) (COMMAND "CHPROP" jset "" "LT" "PHANTOM" "") (setq jset nil))
(DEFUN C:D () (COMMAND "DIM")) (DEFUN C:DA () (C:SLD) (COMMAND "DIM") (EON) (COMMAND "ANG" PAUSE PAUSE PAUSE "" "" "EXIT") (EOF)) (DEFUN C:DAL () (C:SLD) (SETVAR "OSMODE" 32) (EON) (COMMAND "DIM" "ALIGNED" PAUSE PAUSE PAUSE "" "EXIT") (EOF) (SETVAR "OSMODE" 0)) (DEFUN C:DD () (C:SLD) (EON) (COMMAND "DIM" "DIA") (EOF)) (DEFUN C:DDA () (COMMAND "DDATTE")) (DEFUN C:DDI () (C:DDINSERT ))
(DEFUN C:DE () (SETVAR "OSMODE" 1) (EON) (COMMAND "DIST" PAUSE PAUSE) (GETSTRING "Press ENTER to continue...") (EOF) (SETVAR "OSMODE" 0) (princ))
(DEFUN C:DH () (C:SLD) (EON) (SETVAR "OSMODE" 1) (COMMAND "DIM" "HORIZ" PAUSE PAUSE PAUSE "" "EXIT") (SETVAR "OSMODE" 0) (EOF)) (DEFUN C:DI () (COMMAND "DIVIDE")) (DEFUN C:DL () (C:SLD) (COMMAND "DIM" "LEADER"))
(DEFUN C:DLF () (EON) (COMMAND "DIM" "DIMLFAC" PAUSE "EXIT") (EOF)) (DEFUN C:DMS () (EON) (COMMAND "DIM" "DIMSCALE" PAUSE "EXIT") (EOF)) (DEFUN C:DN () (SETVAR "OSMODE" 512) (EON) (COMMAND "DIST" PAUSE PAUSE) (EOF) (SETVAR "OSMODE" 0)) (DEFUN C:DNU () (COMMAND "DIM" "NEW")) (DEFUN C:DR () (C:SLD) (EON) (COMMAND "DIM" "RAD") (EOF)) (DEFUN C:DS () (EON) (COMMAND "DIST") (EOF)) (DEFUN C:DT () (COMMAND "DONUT")) (DEFUN C:DU () (COMMAND "DIM" "UPDATE" "AUTO")) (DEFUN C:DV () (C:SLD) (EON) (SETVAR "OSMODE" 1) (COMMAND "DIM" "VERT" PAUSE PAUSE PAUSE "" "EXIT")(SETVAR "OSMODE" 0) (EOF)) (DEFUN C:EL () (COMMAND "ELLIPSE")) (DEFUN C:EX () (COMMAND "EXPLODE")) (DEFUN C:FI () (EON) (COMMAND "FILLET" "r" PAUSE "FILLET") (EOF)) (DEFUN C:FL () (COMMAND "LAYER" "F"))
(DEFUN C:FL2 (/ jset) (princ "\nChange to BYLAYER linetype & color") (setq jset (ssget)) (COMMAND "CHPROP" jset "" "LT" "BYLAYER" "CO" "BYLAYER" "") (setq jset nil))
(DEFUN C:FR () (COMMAND "FILLET" "R" "0") (COMMAND "FILLET")) (DEFUN C:H () (COMMAND "HATCH"))
(DEFUN C:I () (EOF) (if (= (getvar "CLAYER") "DIMENSION" ) ;if current layer is Dimension layer then change to object layer (C:SLO) );if (COMMAND "INSERT") );I
(DEFUN C:K () (COMMAND "COPY")) (DEFUN C:L () (COMMAND "LINE")) (DEFUN C:LA () (COMMAND "LAYER")) (DEFUN C:LAL () (COMMAND "LAYER" "LOCK")) (DEFUN C:LAU () (COMMAND "LAYER" "UNLOCK"))
(DEFUN C:LC () (EON) (COMMAND "LINE" "CEN") (EOF)) (DEFUN C:LCC () (EON) (COMMAND "LINE" "CEN" PAUSE "CEN") (EOF)) (DEFUN C:LCE () (EON) (COMMAND "LINE" "CEN" PAUSE "ENDP") (EOF)) (DEFUN C:LCI () (EON) (COMMAND "LINE" "CEN" PAUSE "INT") (EOF)) (DEFUN C:LCM () (EON) (COMMAND "LINE" "CEN" PAUSE "MID") (EOF)) (DEFUN C:LCN () (EON) (COMMAND "LINE" "CEN" PAUSE "NODE") (EOF)) (DEFUN C:LCP () (EON) (COMMAND "LINE" "CEN" PAUSE "PERP") (EOF)) (DEFUN C:LCQ () (EON) (COMMAND "LINE" "CEN" PAUSE "QUAD") (EOF)) (DEFUN C:LCT () (EON) (COMMAND "LINE" "CEN" PAUSE "TAN") (EOF))
(DEFUN C:LE () (EON) (SETVAR "OSMODE" 1) (COMMAND "LINE" PAUSE) (SETVAR "OSMODE" 0) (EOF)) (DEFUN C:LEC () (EON) (COMMAND "LINE" "ENDP" PAUSE "CEN") (EOF)) (DEFUN C:LEE () (EON) (COMMAND "LINE" "ENDP" PAUSE "ENDP") (EOF)) (DEFUN C:LEI () (EON) (COMMAND "LINE" "ENDP" PAUSE "INT") (EOF)) (DEFUN C:LEM () (EON) (COMMAND "LINE" "ENDP" PAUSE "MID") (EOF)) (DEFUN C:LEN () (EON) (COMMAND "LINE" "ENDP" PAUSE "NODE") (EOF)) (DEFUN C:LEP () (EON) (COMMAND "LINE" "ENDP" PAUSE "PERP") (EOF)) (DEFUN C:LEQ () (EON) (COMMAND "LINE" "ENDP" PAUSE "QUAD") (EOF)) (DEFUN C:LET () (EON) (COMMAND "LINE" "ENDP" PAUSE "TAN") (EOF))
(DEFUN C:LF () (COMMAND "LAYER" "OF"))
(DEFUN C:LI () (EON) (COMMAND "LINE" "INT") (EOF)) (DEFUN C:LIC () (EON) (COMMAND "LINE" "INT" PAUSE "CEN") (EOF)) (DEFUN C:LIE () (EON) (COMMAND "LINE" "INT" PAUSE "ENDP") (EOF)) (DEFUN C:LII () (EON) (COMMAND "LINE" "INT" PAUSE "INT") (EOF)) (DEFUN C:LIM () (EON) (COMMAND "LINE" "INT" PAUSE "MID") (EOF)) (DEFUN C:LIN () (EON) (COMMAND "LINE" "INT" PAUSE "NODE") (EOF)) (DEFUN C:LIP () (EON) (COMMAND "LINE" "INT" PAUSE "PERP") (EOF)) (DEFUN C:LIQ () (EON) (COMMAND "LINE" "INT" PAUSE "QUAD") (EOF)) (DEFUN C:LIT () (EON) (COMMAND "LINE" "INT" PAUSE "TAN") (EOF))
(DEFUN C:LM () (EON) (COMMAND "LINE" "MID") (EOF)) (DEFUN C:LMC () (EON) (COMMAND "LINE" "MID" PAUSE "CEN") (EOF)) (DEFUN C:LME () (EON) (COMMAND "LINE" "MID" PAUSE "ENDP") (EOF)) (DEFUN C:LMI () (EON) (COMMAND "LINE" "MID" PAUSE "INT") (EOF)) (DEFUN C:LMM () (EON) (COMMAND "LINE" "MID" PAUSE "MID") (EOF)) (DEFUN C:LMN () (EON) (COMMAND "LINE" "MID" PAUSE "NODE") (EOF)) (DEFUN C:LMP () (EON) (COMMAND "LINE" "MID" PAUSE "PERP") (EOF)) (DEFUN C:LMQ () (EON) (COMMAND "LINE" "MID" PAUSE "QUAD") (EOF)) (DEFUN C:LMT () (EON) (COMMAND "LINE" "MID" PAUSE "TAN") (EOF))
(DEFUN C:LN () (EON) (COMMAND "LINE" "NODE") (EOF)) (DEFUN C:LNC () (EON) (COMMAND "LINE" "NODE" PAUSE "CEN") (EOF)) (DEFUN C:LNE () (EON) (COMMAND "LINE" "NODE" PAUSE "ENDP") (EOF)) (DEFUN C:LNI () (EON) (COMMAND "LINE" "NODE" PAUSE "INT") (EOF)) (DEFUN C:LNM () (EON) (COMMAND "LINE" "NODE" PAUSE "MID") (EOF)) (DEFUN C:LNN () (EON) (COMMAND "LINE" "NODE" PAUSE "NODE") (EOF)) (DEFUN C:LNP () (EON) (COMMAND "LINE" "NODE" PAUSE "PERP") (EOF)) (DEFUN C:LNQ () (EON) (COMMAND "LINE" "NODE" PAUSE "QUAD") (EOF)) (DEFUN C:LNT () (EON) (COMMAND "LINE" "NODE" PAUSE "TAN") (EOF))
(DEFUN C:LO () (COMMAND "LAYER" "ON")) (DEFUN C:LP () (EON) (COMMAND "LINE" "PERP") (EOF))
(DEFUN C:LQ () (EON) (COMMAND "LINE" "QUAD") (EOF)) (DEFUN C:LQC () (EON) (COMMAND "LINE" "QUAD" PAUSE "CEN") (EOF)) (DEFUN C:LQE () (EON) (COMMAND "LINE" "QUAD" PAUSE "ENDP") (EOF)) (DEFUN C:LQI () (EON) (COMMAND "LINE" "QUAD" PAUSE "INT") (EOF)) (DEFUN C:LQM () (EON) (COMMAND "LINE" "QUAD" PAUSE "MID") (EOF)) (DEFUN C:LQN () (EON) (COMMAND "LINE" "QUAD" PAUSE "NODE") (EOF)) (DEFUN C:LQQ () (EON) (COMMAND "LINE" "QUAD" PAUSE "QUAD") (EOF)) (DEFUN C:LQP () (EON) (COMMAND "LINE" "QUAD" PAUSE "PERP") (EOF)) (DEFUN C:LQT () (EON) (COMMAND "LINE" "QUAD" PAUSE "TAN") (EOF))
(DEFUN C:LS () (COMMAND "LAYER" "S"))
(DEFUN C:LT () (EON) (COMMAND "LINE" "TAN") (EOF)) (DEFUN C:LTC () (EON) (COMMAND "LINE" "TAN" PAUSE "CEN") (EOF)) (DEFUN C:LTE () (EON) (COMMAND "LINE" "TAN" PAUSE "ENDP") (EOF)) (DEFUN C:LTI () (EON) (COMMAND "LINE" "TAN" PAUSE "INT") (EOF)) (DEFUN C:LTM () (EON) (COMMAND "LINE" "TAN" PAUSE "MID") (EOF)) (DEFUN C:LTN () (EON) (COMMAND "LINE" "TAN" PAUSE "NODE") (EOF)) (DEFUN C:LTP () (EON) (COMMAND "LINE" "TAN" PAUSE "PERP") (EOF)) (DEFUN C:LTQ () (EON) (COMMAND "LINE" "TAN" PAUSE "PERP") (EOF)) (DEFUN C:LTT () (EON) (COMMAND "LINE" "TAN" PAUSE "TAN") (EOF))
(DEFUN C:LU () (COMMAND "SETVAR" "LUPREC")) (DEFUN C:M () (MENUCMD "S=MOVE") (COMMAND "MOVE" "AUTO")) (DEFUN C:MI () (COMMAND "MINSERT")) (DEFUN C:MR () (MENUCMD "S=MIRROR") (COMMAND "MIRROR" "AUTO")) (DEFUN C:MS () (COMMAND "MEASURE")) (DEFUN C:N () (SETVAR "OSMODE" 0)) (DEFUN C:O () (COMMAND "OFFSET")) (DEFUN C:OP () (COMMAND "OPEN")) (DEFUN C:OT () (COMMAND "OFFSET" "T")) (DEFUN C:P () (COMMAND "ZOOM" "P")) (DEFUN C:PE () (COMMAND "PEDIT")) (DEFUN C:PEJ () (COMMAND "PEDIT" PAUSE "Y" "J")) (DEFUN C:PG () (COMMAND "POLYGON")) (DEFUN C:PL () (COMMAND "PLINE")) (DEFUN C:PN () (COMMAND "PAN")) (DEFUN C:PT () (COMMAND "POINT")) (DEFUN C:R () (MENUCMD "S=ROTATE") (COMMAND "ROTATE" "AUTO")) (DEFUN C:RE () (COMMAND "REDO")) (DEFUN C:RG () (COMMAND "REGEN")) (DEFUN C:S () (COMMAND "STRETCH" "C")) (DEFUN C:SC () (MENUCMD "S=SCALE") (COMMAND "SCALE" "AUTO")) (DEFUN C:SLB () (COMMAND "LAYER" "SET" "BLANK" "")) (DEFUN C:SLC () (COMMAND "LAYER" "SET" "CENTER" "")) (DEFUN C:SLD () (COMMAND "LAYER" "SET" "DIMENSION" "")) (DEFUN C:SLH () (COMMAND "LAYER" "SET" "HIDDEN" "")) (DEFUN C:SLHH () (COMMAND "LAYER" "SET" "HATCH" "")) (DEFUN C:SLHR () (COMMAND "LAYER" "SET" "HATCHR" "")) (DEFUN C:SLO () (COMMAND "LAYER" "SET" "OBJECT" "")) (DEFUN C:SLP () (COMMAND "LAYER" "SET" "PHANTOM" "")) (DEFUN C:SL0 () (COMMAND "LAYER" "SET" "0" "")) (DEFUN C:SO () (COMMAND "SOLID")) (DEFUN C:SV () (COMMAND "SAVE")) (DEFUN C:SW () (COMMAND "STRETCH" "W")) (DEFUN C:T () (MENUCMD "S=TRIM") (COMMAND "TRIM" "AUTO")) (DEFUN C:TA () (C:SLD) (COMMAND "DTEXT" "A")) (DEFUN C:TC () (C:SLD) (COMMAND "DTEXT" "C")) (DEFUN C:TF () (C:SLD) (COMMAND "DTEXT" "F")) (DEFUN C:TH () (COMMAND "LAYER" "THAW")) (DEFUN C:TM () (C:SLD) (COMMAND "DTEXT" "M")) (DEFUN C:TR () (C:SLD) (COMMAND "DTEXT" "R")) (DEFUN C:TL () (C:SLD) (COMMAND "DTEXT")) (DEFUN C:U1 () (COMMAND "UNDO" 1))
;View commands (DEFUN C:V () (COMMAND "VIEW" "R")) (DEFUN C:VE () (COMMAND "VIEW" "R" "E")) (DEFUN C:VF () (COMMAND "VIEW" "R" "F")) (DEFUN C:VG () (COMMAND "VIEW" "R" "G")) (DEFUN C:VN () (COMMAND "VIEW" "R" "N")) (DEFUN C:VS () (COMMAND "VIEW" "S")) (DEFUN C:VSP () (COMMAND "VIEW" "R" "SP")) (DEFUN C:VT () (COMMAND "VIEW" "R" "T")) (DEFUN C:VW () (COMMAND "VIEW" "W")) (DEFUN C:VX () (COMMAND "VIEW" "R" "X"))
(DEFUN C:W () (COMMAND "ZOOM" "W")) (DEFUN C:WB () (COMMAND "WBLOCK")) (DEFUN C:WC () (COMMAND "ZOOM" "C" PAUSE PAUSE)) (DEFUN C:WL () (COMMAND "ZOOM" "L" PAUSE PAUSE)) (DEFUN C:X () (COMMAND "EXTEND")) (DEFUN C:ZA () (COMMAND "ZOOM" "A")) (DEFUN C:ZD () (COMMAND "ZOOM" "D")) (DEFUN C:ZE () (COMMAND "ZOOM" "E")) (DEFUN C:ZP () (COMMAND "ZOOM" "P")) (LOAD "LINEMEND") (LOAD "REF")
This is an extra (for joining two lines to make one):
(defun C:Linemend ( / ent1 ent2 params1 1pt10 2pt10 old10 1pt11 2pt11 old11 dist1 dist2 dist3 dist4 distlist maxdist pt1 pt10 pt11) (setq ent1 (entsel "\nSelect first line: ")) (setvar "cmdecho" 0) (setvar "orthomode" 1) (while ent1 (setq ent1 (car ent1)) (redraw ent1 3) (setq ent2 (car (entsel "\nSelect second line: "))) (while (null ent2) (prompt "\nNo entity found.") (setq ent1 (car (entsel "\nSelect second line: "))) (if (/= (cdr (assoc 0 (entget ent2))) "LINE") (progn (prompt "\nLines Only!") (setq ent2 nil) ) ;progn ) ;if ) ;while
(redraw ent2 3) (setq params1 (entget ent1) 1pt10 (cdr (setq old10 (assoc 10 params1))) 1pt11 (cdr (setq old11 (assoc 11 params1))) params2 (entget ent2) 2pt10 (cdr (assoc 10 params2)) 2pt11 (cdr (assoc 11 params2)) dist1 (distance 1pt10 2pt10) dist2 (distance 1pt10 2pt11) dist3 (distance 1pt11 2pt10) dist4 (distance 1pt11 2pt11) distlist (list (list dist1 1pt10 2pt10) (list dist2 1pt10 2pt11) (list dist3 1pt11 2pt10) (list dist4 1pt11 2pt11) );list maxdist (max dist1 dist2 dist3 dist4) pts (cdr (assoc maxdist distlist)) pt10 (car pts) pt11 (cadr pts) params1 (subst (cons 10 pt10) old10 params1) params1 (subst (cons 11 pt11) old11 params1) ) ;setq calculations
(entdel ent2) (entmod params1) (entupd ent1) (setq ent1 (entsel "\nSelect first line: ")) ) ;while loop
(setvar "cmdecho" 1) (gc) (princ) ) ;defun
and this is the "ref" code for doing anything with reference to some other entity:
; REF.LSP
; This is a useful routine for obtaining a relative point. ; It can be used whenever an AutoCAD command requests a point. ; Just enter "(ref)" in response to the "...point:" prompt, and ; enter the desired base (reference) point and the relative/polar ; offset from that point. For example:
; Command: LINE ; From point: (ref) ; Reference point: (...pick a point...) ; Enter relative/polar coordinate (with @): @x,y or @dist<angle ; To point:
(defun ref () (setvar "LASTPOINT" (getpoint "Reference point: ")) (getpoint "\nEnter relative/polar coordinates (with @): ") )
Add pictures here
✖
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload

Polytechforum.com is a website by engineers for engineers. It is not affiliated with any of manufacturers or vendors discussed here. All logos and trade names are the property of their respective owners.