Documente Academic
Documente Profesional
Documente Cultură
Course Outline:
Simple AutoLISP for Maximum Productivity
(TJ 6)
)
(defun C:BL ()
(TJ 7)
)
(defun C:BC ()
(TJ 8)
)
(defun C:BR ()
(TJ 9)
)
;~*CPA...Cutting Plane Arrow, SCL...Section Line
(defun C:TB ()
(command "PSPACE")
(command "-INSERT" "C:/AU2002/TB.DWG" "int" pause "1" "1" "0" "" "" "" "" "" "" "" "" "" "" "" "")
(command "DDATTE" "l")
)
(defun c:CPA ()
(command "insert" "CPA" "endp")
)
(defun c:SCL ()
(command "-la" "s" "section" "")
(command "line" )
)
;~*Arrow Head Sizes - Dimension Override
;~*ASZ-SM...0.125, ASZ-MD...0.1875, ASZ-LG...0.250
(defun C:ASZS ()
(command "dimoverride" "dimasz" "0.125" "")
)
(defun C:ASZM ()
(command "dimoverride" "dimasz" "0.1875" "")
)
(defun C:ASZL ()
(command "dimoverride" "dimasz" "0.25" "")
)
www.autodesk.com 3
Simple AutoLISP for Maximum Productivity
www.autodesk.com 4
Simple AutoLISP for Maximum Productivity
(defun C:SEV ()
(command "dimoverride" "dimse1" "off" "dimse2" "off" "")
)
;~*Decimal Places - Dimension Override
;~*DEC1...0, DEC2...2, DEC3...3, DEC4...4, DEC5...5 places
(defun C:DEC1 ()
(command "dimoverride" "dimdec" "1" "dimaltd" "1" "dimtdec" "1" "")
)
(defun C:DEC2 ()
(command "dimoverride" "dimdec" "2" "dimaltd" "2" "dimtdec" "2" "")
)
(defun C:DEC3 ()
(command "dimoverride" "dimdec" "3" "dimaltd" "3" "dimtdec" "3" "")
)
(defun C:DEC4 ()
(command "dimoverride" "dimdec" "4" "dimaltd" "4" "dimtdec" "4" "")
)
(defun C:DEC5 ()
(command "dimoverride" "dimdec" "5" "dimaltd" "5" "dimtdec" "5" "")
)
;~*Dim Text Modification - Dimension Override
;~*DIA...Diameter Sym for Linear, REF...Reference Parens, DUAL...Dual,
;~*DUALS...Dual Stack, BASIC...Basic Box, NTS... Not to Scale
(defun C:BAS ()
(CDM)
(command "dimoverride" "dimgap" "-.09" "")
(CDM-R)
)
(defun C:DIA ()
(CDM)
(command "dimedit" "n" "%%C<>")
(CDM-R)
)
(defun C:NTS ()
www.autodesk.com 5
Simple AutoLISP for Maximum Productivity
(CDM)
(command "dimedit" "n" "%%U<>%%u")
(CDM-R)
)
(defun C:REF ()
(CDM)
(command "dimedit" "n" "(<>)")
(CDM-R)
)
;~*Dimstyles - Dimension Override
(defun C:ENG ()
(command "dimoverride" "dimstyle" "MECH-ENG" "" "all" "")
)
(defun C:MET ()
(command "dimoverride" "dimstyle" "MECH-MET" "" "all" "")
)
(defun C:ARCH ()
(command "dimoverride" "dimstyle" "ARCH" "" "all" "")
)
;(defun C:LIM ()
; (command "dimoverride" "DIMLIM" "on" "")
;)
(defun C:TM3 ()
(setvar "DIMTM" "0.003")
(command "dimoverride" "dimtm" ".003" "")
)
;~*TM1...Tolerance Plus Value - .004
(defun C:TM4 ()
(setvar "DIMTM" "0.004")
(command "dimoverride" "dimtm" ".004" "")
)
;~*TM1...Tolerance Plus Value - .005
(defun C:TM5 ()
(setvar "DIMTM" "0.005")
(command "dimoverride" "dimtm" ".005" "")
)
;~*TP1...Tolerance Plus Value - .001
(defun C:TP1 ()
(setvar "DIMTP" "0.001")
(command "dimoverride" "dimtp" ".001" "")
)
;~*TP2...Tolerance Plus Value - .002
(defun C:TP2 ()
(setvar "DIMTP" "0.001")
(command "dimoverride" "dimtp" ".002" "")
)
;~*TP3...Tolerance Plus Value - .003
(defun C:TP3 ()
(setvar "DIMTP" "0.003")
(command "dimoverride" "dimtp" ".003" "")
)
;~*TP4...Tolerance Plus Value - .004
(defun C:TP4 ()
(setvar "DIMTP" "0.004")
(command "dimoverride" "dimtp" ".004" "")
)
;~*TP5...Tolerance Plus Value - .005
www.autodesk.com 8
Simple AutoLISP for Maximum Productivity
(defun C:TP5 ()
(setvar "DIMTP" "0.005")
(command "dimoverride" "dimtp" ".005" "")
)
;~*RTP...Real Time Pan
(defun C:RTP ()
(command "rtpan")
)
;~*RTZ...Real Time Zoom
(defun C:RTZ ()
(command "rtzoom")
)
;~*LIM... Calls Tolerancing Dialog Box for Dim Overrides
(defun c:LIM ()
(setq dcl_id (load_dialog "//wsql/drafting$/acad/menu/limits.dcl"))
; (new_dialog "limits" dcl_id)
(if (not (new_dialog "limits" dcl_id))(exit))
(start_dialog)
(unload_dialog dcl_id)
(if (= LIM "1")
(progn
(setq LIM 1
VAR 0
)
)
(progn
(setq VAR 1
LIM 0
)
)
)
(setq PLUS (atof PLUS)
MINUS (atof MINUS)
)
(command "dimoverride" "dimtol" VAR "dimlim" LIM "dimtp" PLUS "dimtm" MINUS "")
www.autodesk.com 9
Simple AutoLISP for Maximum Productivity
(defun C:UN ()
(unload_dialog dcl_id)
)
;Sub-Routines for Above
;CDM - Command Dialog Mode
(defun CDM ()
(setq CDMO (getvar "cmddia"))
(setvar "cmddia" 0)
)
(defun CDM-R ()
(setvar "cmddia" CDMO)
)
;Text Justification
;(TJ a)
;a passed arguement of the Bit code for justification
(defun TJ (a)
;Gathering Data
(setq ENT (entsel "/nPick Text to Change Justification: ")
ENT-LST (entget (car ENT))
TXT-JST (assoc 71 ENT-LST)
JST (cdr TXT-JST)
)
;Manipulating Data
(setq NEW-JST a
NEW-LST (cons 71 NEW-JST)
SUB-JST (subst NEW-LST TXT-JST ENT-LST)
)
;Apply New Data
(entmod SUB-JST)
)
;Text Size
;(TS a)
;a passed arguement of the Bit code for justification
www.autodesk.com 10
Simple AutoLISP for Maximum Productivity
(defun TS (a)
;Gathering Data
(setq ENT (entsel "/nPick Text to Change Size: ")
ENT-LST (entget (car ENT))
TXT-JST (assoc 40 ENT-LST)
JST (cdr TXT-JST)
)
;Manipulating Data
(setq NEW-JST a
NEW-LST (cons 40 NEW-JST)
SUB-JST (subst NEW-LST TXT-JST ENT-LST)
)
;Apply New Data
(entmod SUB-JST)
)
(defun C:SD1 ()
(command "DIMOVERRIDE" "DIMSD1" "on" "DIMSD2" "off" "")
)
(defun C:SD2 ()
(command "DIMOVERRIDE" "DIMSD2" "on" "DIMSD1" "off" "")
)
(defun C:SDB ()
(command "DIMOVERRIDE" "DIMSD1" "on" "DIMSD2" "on" "")
)
(defun C:SDV ()
(command "DIMOVERRIDE" "DIMSD1" "off" "DIMSD2" "off" "")
)
www.autodesk.com 11