vendredi 26 février 2010

AutoCad - Ancrage - Ancrer la fenêtre de texte - fenêtre de ligne de commande

Il s'agit de deux entités différentes, et on peut chercher longtemps à ancrer la fenêtre de texte AutoCad... Sans y parvenir.
Alors que la manipulation à effectuter consiste à afficher la fenêtre de ligne de commande (malencontreusement fermée).
CTRL+9 (9 du pavé texte) bascule l'état de la FENETRE DE LIGNE DE COMMANDE entre  - OUVERTE et - FERMEE.

(vu sur AutoCad 2009)

mardi 23 février 2010

AutoCad - Les commandes transparentes

Une notion à explorer : l'exécution de commandes transparentes pendant une commande en cours.
Exemple : pendant la commande LIGNE, exécuter la commande ZOOM de manière transparente : 'ZOOM

dimanche 21 février 2010

AutoLisp - Fonctions DCL

Récupéré sur : http://www.afralisp.net

AutoLISP Functions for Dialog Control Language (DCL)



(action_tile key action-expression)
Assigns an action to evaluate the user selected specif tile in a dialog box 
(add_list string) Adds or modifies a string in the currently active dialog box list
(client_data_tile key clientdata) Associates application-managed data with a dialog box tile
(dimx_tile key) and ( dimy_tile key)
Retrieves the dimensions of a tile in dialog box units
(done_dialog [status])
Terminates a dialog box. If you specify the optional status argument, it must be a positive integer, which start_dialog will return instead of returning 1 for OK or 0 for Cancel. The meaning of any status value greater than 1 depends on your application.
(end_image)
Ends creation of the currently active dialog box image This function is the complement of (start_image)
(end_list)
Ends processing of the currently active dialog box list This function is the complement of start_list.
(fill_image x1 y1 wid hgt color)
Draws a filled rectangle in the currently active dialog box image tile The fill_image function must be used between start_image and end_image calls. The color parameter is an AutoCAD color number or one of the logical color numbers shown in the following table.
Symbolic names for the color attribute

Color number ADI mnemonic Description
-2 BGLCOLOR Current background of the AutoCAD graphics screen
-15 DBGLCOLOR Current dialog box background color
-16 DFGLCOLOR Current dialog box foreground color (text)
-18 LINELCOLOR Current dialog box line color
The first (upper-left) corner of the rectangle is located at (x1,y1) and the second (lower-right) corner is located the relative distance (wid,hgt) from the first corner (wid and hgt must be positive values). The origin (0,0) is the upper-left corner of the image. You can obtain the coordinates of the lower-right corner by calling the dimension functions dimx_tile and dimy_tile.
(get_attr key attribute)
Retrieves the DCL value of a dialog box attribute
The key argument is a string that specifies the tile and is case sensitive. The attribute argument specifies the name of the attribute as it appears in the tile's DCL description. Both the key and attribute arguments are strings. The value returned is the attribute's initial value as specified in its DCL description; it does not reflect changes to the state of the tile that come about with user input or set_tile calls. Returns the attribute value as a string.
(get_tile key)
Retrieves the current run-time value of a dialog box tile The key argument is a string that specifies the tile and is case sensitive. It returns the tile's value as a string.
(load_dialog dclfile)
Loads a DCL file The dclfile argument is a string that specifies the DCL file to load. If the dclfile argument does not specify a file extension, .dcl is assumed. Returns a positive integer value (dcl_id) if successful, and returns a negative integer if it can't open the file. The dcl_id is used as a handle in subsequent new_dialog and unload_dialog calls.
The load_dialog function searches for files according to the AutoCAD library search path.

This function is the complement of unload_dialog. An application can load multiple DCL files with multiple load_dialog calls.
(mode_tile key mode)
Sets the mode of a dialog box tile The key argument is a string that specifies the tile and is case sensitive. The mode argument is an integer value. The mode argument values are described in the following table.
Mode argument values

Value Description
0 Enable tile
1 Disable tile
2 Set focus to tile
3 Select edit box contents

4 Flip image highlighting on or off
(new_dialog dlgname dcl_id [action [screen-pt]])
Begins a new dialog box and displays it, and can also specify a default action The dlgname argument is a string that specifies the dialog box, and dcl_id identifies the DCL file (you must have obtained its value from the load_dialog call).
The action argument, which must be specified if you specify screen-pt, is a string that contains an AutoLISP expression to use as the default action. If you don't want to define a default action, pass action as the empty string (""). The screen-pt argument is a 2D point list that specifies the X,Y location of the dialog box on the screen. The point usually specifies the upper-left corner of the dialog box, but this is platform dependent, as is the system of units in which the location is specified. If you pass the point as'(-1 -1), the dialog box is opened in the default position (the center of the AutoCAD graphics screen).


If new_dialog succeeds, it returns T; otherwise it returns nil.
Your application must call new_dialog before it calls start_dialog. All dialog box initialization--such as setting tile values, creating images or lists for list boxes, and associating actions with specific tiles (with the use of action_tile)--must take place after the new_dialog call and before the start_dialog call.
The default action is evaluated when the user picks an active tile that doesn't have an action or callback explicitly assigned to it by action_tile or in DCL.

Note Always check the status new_dialog returns. Calling start_dialog when the new_dialog call failed can have unpredictable results.
(set_tile key value)
Sets the value of a dialog box tile The key argument is a string that specifies the tile, and value is a string that names the new value to assign (initially set by the value attribute).
sldname or libname(sldname)
Displays an AutoCAD slide in the currently active dialog box image tile (slide_image x1 y1 wid hgt sldname)
The slide can be a slide file (.sld) or a slide in a slide library file (.slb): the sldname argument specifies it as you would specify it for the VSLIDE command or for a menu file.
The first (upper-left) corner of the slide--its insertion point--is located at (x1,y1), and the second (lower-right) corner is located at the relative distance (wid,hgt) from the first (wid and hgt must be positive values). The origin (0,0) is the upper-left corner of the image. You obtain the coordinates of the lower-right corner by calling the dimension functions (dimx_tile and dimy_tile).
(start_dialog)
Displays a dialog box and begins accepting user input You must first initialize the dialog box by a previous new_dialog call. The dialog box remains active until an action expression or callback function calls done_dialog. Usually done_dialog is associated with the tile whose key is "accept" (typically the OK button) and the tile whose key is "cancel" (typically the Cancel button).
The start_dialog function has no arguments. It returns the optional status passed to done_dialog. The default value is 1 if the user pressed OK, 0 if the user pressed Cancel, or -1 if all dialog boxes were terminated with term_dialog. But if done_dialog is passed an integer status greater than 1, start_dialog returns this value, whose meaning depends on the application.
(start_image key)
Starts the creation of an image in the dialog box tile Subsequent calls to fill_image, slide_image, and vector_image affect this image until the application calls end_image. The key argument is a string that specifies the dialog box tile. The key argument is case sensitive.

Note Do not use the set_tile function between start_image and end_image function calls.
(start_list key [operation [index]])
Starts the processing of a list in the list box or in the pop-up list dialog box tile The key argument is a string that specifies the dialog box tile. The key argument is case sensitive. The operation argument is an integer value whose meaning is summarized in the following table.
List box codes for start_list

Value Description
1 Change selected list contents
2 Append new list entry
3 Delete old list and create new list (the default)
The index argument is ignored unless the start_list call begins a change operation (1), in which case index indicates the list item to change by the subsequent add_list call. The index is zero based. If you don't specify operation, it defaults to 3 (create new list), and if you specify operation but not index, the index defaults to 0.
Subsequent calls to add_list affect the list started by start_list until the application calls end_list.

Note Do not use the set_tile function between start_list and end_list function calls.
(term_dialog)
Terminates all current dialog boxes as if the user had canceled each of them If an application is terminated while any DCL files are open, AutoCAD automatically calls term_dialog. This function is used mainly for aborting nested dialog boxes. The term_dialog function always returns nil.
(unload_dialog dcl_id)
Unloads a DCL file Unloads the DCL file associated with dcl_id (which was obtained from a previous new_dialog call).
Always returns nil.
(vector_image x1 y1 x2 y2 color)
Draws a vector in the currently active dialog box image This function draws a vector in the currently active dialog box image (opened by start_image) from the point (x1,y1) to (x2,y2). The color parameter is an AutoCAD color number or one of the logical color numbers shown in the following table.
Symbolic names for the color attribute

Color
number ADI
mnemonic
Description
-2 BGLCOLOR Current background of the AutoCAD graphics screen
-15 DBGLCOLOR Current dialog box background color
-16 DFGLCOLOR Current dialog box foreground color (for text)
-18 LINELCOLOR Current dialog box line color
The origin (0,0) is the upper-left corner of the image. You can obtain the coordinates of the lower-right corner by calling the dimension functions (dimx_tile and dimy_tile).

vendredi 5 février 2010

Autocad : Liste des commandes dans le contexte de programmes Lisp

; 3D
(command "_3dorbit")
(command "3dface" el1....el5 "")
(command "_.3DMESH" "6" "3" pt1....pt5)
(command "3dpoly")
(repeat leng
(repeat (1+ seg)
(setq x (* rad (sin (* cnt ang))))
(setq y (* rad (cos (* cnt ang))))
(setq z (* cnt (/ pit seg)))
(setq point (list x y z))
(command point)
(setq cnt (1+ cnt))
)
)
(command "")

(command "_.3dpoly")
(foreach pt splist
(command pt)
)
(command "")

; A
(command "_arc" p1 p2 p3 "")
(command "_arc" p1 "e" p2 "a" 30)
(command "_arc" p1 "e" p2 "r" 150 "")
(command "_arc" p1 "c" p2 "l" 8 "")
(command "_arc" "c" p1 p2 p3 "")

(command "_area" "o" el)
(command "_area" "a" "o" el1...el2 "" "")
(command "_area" "s" el1 "" el2 "")
(command ".area" "e" el)
(command "_area" "_o" el)
(command "area" "o" el)
(command "_.area" "_ob" (entlast))

(command "_array" el "" "p" loc 7 360 "" "")
(command "_array" "l" "" "p" loc 7 "" "")
(command "_array" el "" "P" loc 7 90 45)
(command "_array" el "" "r" nr "1" y)
(command "_array" el "" "r" "1" nc x)
(command "_array" el "" "r" nr nc y x)
(command "_array" (entlast) "" "r" p1 p2 p3 p4)
(command "_array" el "" "r" total_row total_column pitch)

(command "_.attedit" "Y" "" "" "" blk "" "c" "1" "")
(command "attedit" "" "" "" "" (cadr ent) "" "V" "" newdate "")
(command "-attedit"
"Y"
"YourBlockName" ; name of block
"YourTagName" ; name of tag
""
"W" ; window selected area
"-1000,-1000" ; cordinate first
"1000,1000" ; cordinate second
"Value"
"Replace"
str
"")

; B
(command "_.-BLOCK" bn "_Y" pt ssetn "")
(setq bn (getstring t "\nEnter name for block: "))
(setq bp (getpoint "\nClick as base point block: "))
(prompt "\nSelect object would become block")
(setq ss (ssget))
(command "_-block" bn bp ss "")

(command "_bhatch" "p" "ansi31" 10 0 loc2 "")

(setq click (getpoint "\nPick inner box: "))
(command "_boundary" click "")

(command "._break" ent "_F" pt2 pt3)
(command "break" ss "f" point "@")
(command "break" newpt1 newpt2 nil)
(command "_break" ss pt1 pt2)

(command "browser" UrlStr)

; C
(if
(not (member "geom3d.arx" (arx)))
(arxload "geom3d")
) ; if
(setq Bolt 4)
(c:cal "Bolt * 4")

(command "_chamfer" "d" 0.5 0.5 "" "_chamfer" el2 el3 "")

(command "_change" es2 es3 es4 es5 es6 es7 "" "p" "c" 7 "")
(command "_change" ename "" "p" "lt" opt "")
(command "change" dimarc "" "p" "c" "bylayer" "")
(command "change" ss "" "" "" "" "" "" newstr)
(command "change" "l" "" "p" "la" la "")
(command "change" "l" "" "p" "co" co "")
(command "change" "l" "" "p" "lt" lt "")
(command "change" e "" "" "" "" ang "")

(command "change" "l" "" "p" "la" "cenlin" "")

(command "_circle" loc dd2 "")

(command "_clayer" 0 "")

(command "color" "1")
(command "color" "1" "line" pt1 pt2 "")
(command "color" "1" "pline" pt3 "w" "0" "0" pt2 pt1 "a" "d" ang2 pt5 "w" "0" "0" "")

(command "start" "mailto:joelr@watertechnologyinc.com")

(command "copy" SS "" pause)
(command "copy" "l" "" p25 p27)
(command "_.COPY" ss "" "0,0,0" p1)
(command "_.copy" na "" "0,0,0" "0,0,0")

(command "ucs" "world")
(setq oldos (getvar "osmode"))
(command "osnap" "none")
(setq pt1 '(0.0 0.0))
(setq pt2 '(25.0 25.0))
(setq copyent (ssget "_w" pt1 pt2))
(command "_copybase" "0,0" copyent "")
(setq el (entlast))
(setvar "osmode" oldos)
(command "_pasteclip" pause "")

(command "_copyclip" (ssget) "")
(setq p1 (getpoint "\nClick first location: "))
(setq p2 (getcorner p1 "\nClick second location: "))
(command "_copyclip" p1 p2)
(command "_CopyClip" "all" " ")

(command "._chprop" ss "" "la" nl "")
(command "CHPROP" SS "" "la" NEWLAY "")
(command "chprop" "l" "" "c" 1 "")
(command "_.chprop" ss "" "_c" new "")
(Command "_.chprop" SS-LAYER "" "_LA" BLAYER "")
(Command "_.chprop" SS-COLOR "" "_C" BCOLOR "")
(Command "_.chprop" SS-LTYPE "" "_LT" BLTYPE "")

; D
(command ".ddvpoint" "a" 315 "p" 35)

(command "_.delay" 10)

(command "._dim1" "_leader")

(command "_dimaligned")
(while
(> (getvar "cmdactive") 0)
(command pause)
)

(command "-dimstyle" "r" "dleader")
(command "_.dimstyle" "S" tdimsca)
(command "-dimstyle" "r" old-dimstyle)

(command "_divide" p3 (* num 2) "")

(command "_donut" inside_diameter outside_diameter pt "" "")
(command "donut" wd tod uspai "")

(command "dtext" point "" height "" rot_ang "" value "")
(command "_dtext" '(0 0 0) "" 3 "" 0 "" "Adesu is the best" "")

(command "_.DVIEW" "" "_TW" (* a1 (/ 180 pi)) "")

(command "._+dsettings" 0)

; E
(command "elev" (caddr uspai) tw)

(command "._ELLIPSE" p1 p2 p3 2)

(command "_erase" ssn "")
(command "_erase" "w" w1 w2 "")

(command "._VBASTMT" "ThisDrawing.Close False")

(command "._explode" (entlast))

(command "_extend" ssn1 ssn2 "" "e" "e" f2 "")
(command "_extend" p1 "" p2 "")

(command "_extrude" r1l "" hei "0" "")
(command "extrude" (entlast) "" "p" spiral)

(command "_.etransmit" "c" file )

; F
(command "_fillet" es3 es4)
(command "_fillet" "r" 0.5 "_fillet" loc2 "" "c" "e" "")
(command ".fillet" "r" 3 ".fillet" f1 f2 )
(command "fillet" "R" #RAD "fillet" #ENT1 #ENT2)
(command "_.fillet" (car Ent1) (car Ent2))
(command "fillet" "r" 2 0.75)
(command "fillet" "p" "l")
(command "_.FILLET" "_R" "1")
(command "_.FILLET" "_P" "_l")
(command "_fillet" "r" rad "_fillet" "t" "t" es2 es3)
(command "fillet" "R" 5)
(command "fillet" "p" (entlast))

; G

; H
(command "hatch" "ansi31" "20" 45 "" "n" p1 p2 p3 "c" "")
(command "_bhatch" "p" "ansi31" 10 0 loc2 "")

; I
(command "_.-image" "_attach" filename)
(defun c:ii (/ fnm pt sca ang vgao vgad vgms)
(vl-load-com)
(setq fnm (getfiled "Choose Image file" "" "BMP" 4 )) ;
(setq pt '(0 0 0))
(setq sca 1)
(setq ang 0)
(if
fnm
(progn
(setq vgao (vlax-get-acad-object))
(setq vgad (vla-get-ActiveDocument vgao))
(setq vgms (vla-get-ModelSpace vgad))
(vla-AddRaster vgms fnm (vlax-3d-point pt) sca ang)
) ; progn
(alert "\nInvalid selected object image,please try again")
) ; if
) ; defun
(setq file "aw-block.dwg")
(setq pt (getpoint "\nClick location for object: "))
(command "_insert" file pt "" "" "")
(command "_insert" dwgname pt "" "" "" "")
(command "insert" "detbub" "SCALE" scale pause "0" "" "")
(command "insert" "c_arw1" arpt1 gs gs (angtos ang1))
(command "insert" "c_arw2" arpt2 gs gs (angtos ang2))
(command "insert" homearr (dxf 11 ed) (getvar "dimscale") "" (dxf 10 ed))
(command "_insert" "triangle" "" "insbase" "0.1" "0.1" "0" "")
(command "insert" sbl is "" "" "0" )
(command "_.-INSERT" bn "0.0,0.0,0.0" "_XYZ" xsf ysf zsf "0.0")
(command "-insert" "cot_cao_do" pt3 "" "" "" txt "")

; J

; K

; L
(command "_.layer" "n" "red,blue" "c" "1" "red" "c" "5" "blue" "m" "white" "c" "7" "" "")
(command "_layer" "m" "FLOATING BUSH" "c" 1 "" "")
(command "_layer" "n" nlay "")
(command "_.LAYER" "T" "AREA-TEXT" "on" "AREA-TEXT" "s" "AREA-TEXT" "")
(command "_.LAYER" "M" "AREA-TEXT" "C" "201" "" "plot" "no" "AREA-TEXT" "")
(command "_.LAYER" "T" "DATESTAMP" "")
(command "_.LAYER" "N" "DATESTAMP" "C" "7" "DATESTAMP" "S" "DATESTAMP" "")
(command "._layer" "_thaw" LayerName "_on" LayerName "_unlock" LayerName "_set" LayerName "")
(command "LAYER" "THAW" uselayer "SET" uselayer "")
(command "LAYER" "FREEZE" "*" "")
(command "_layer" "f" "Adesu" "")
(command "_.layer" "_UNlock" clayer)
(command "_.LAYER" "_UNLOCK" (getvar "clayer") "")
(command "._LAYER" "_LOCK" (getvar "clayer") "")
(command "_layer" "_c" "8" "~joke alternate" "")
(command "._layer" "_A" "_R" ....)

(command "_layout" "n" "layout10" "")
(command "_layout" "c" "layout1" "layout3")
(command "_layout" "d" "layout10" "")
(command "_layout" "r" "layout3" "Adesu")
(command "_layout" "s" "Adesu")

(command "lengthen" d "")

(command ".limmax" (list 120 80))

(command "_line" "non" loc "non" p1 "") ; if osnap on
(command "_line" p1 p2 "")
(command "_line" spt ept "")
(command "_line" LP1 LP2 "" ".select" "l" "" )

(command "_linetype" "l" "*" lin "")

(command "-linetype" "load" "*" "civild"
(while
(not (zerop (getvar "cmdactive")))
(command "")
) ;end while
) ;end command

(command "_.list" "")

(setq nlay "DIMENSION")
(setq lay (getvar "clayer"))
(if
(/= lay nlay)
(command "_layer" "m" nlay "c" 7 "" "")
)

(command "leader" pnt1 ptxt "" coordn coorde "")

; M
(command "_measure" (entsel) 5)

(command "_mirror" e3 e4 "" loc2 loc3 "")
(command "mirror" "l" "" pt1 "@10<0" "y")

(command "_mline" sp ep "")

(command "_move" p1 "" loc p2 "")
(command ".move" "l" "" p2)
(command "_.move" ss "" "0,0,0" "0,0,0")

(command "_.MSPACE")

(setq p1 '(0 0 0))
(setq p2 '(10 5 0))
(setq str "text of the title text")
(command "_mtext" p1 p2 str "")

(command "_.mview" p1 p2)
(command "_.mview" "_on" (cdr (assoc -1 vp)) "")
(command "_.mview" "_off" (cdr (assoc -1 vp)) "")

; N

; O
(command "offset" "t" oe dimloc "")
(command "offset" off_dst off_obj "from" point1 (strcat "@1<" (rtos perp_angle1)) "")
(command ".offset" (* 2 CRAD) OP1 CP1 "")
(command "offset" (* a cnt) b (polar (cadr b) ang a) "")
(command "_.offset" b na2 a "")
(command "_offset" 0.5 el pt "")

(command "_open" item "")

(command "ortho" "on")

(command "osnap" "off")

; P
(command "_.PAN" (trans p2 3 2) (trans p1 3 2))
(command "pan" "_non" "0,0" "_non" "0,50")

(command "._PEDIT" (entlast) "_W" 2 "X")
(command "._pedit" (entlast) "_yes" "_join" CList "" "")
(command "._pedit" ssn "_yes" "_join" SList "" (strcat "_" CurveType) "")
(command "pedit" "L" "J" sset "" "")
(command "pedit" e1 "y" "j" e2 e3 """")
(command "_.pedit" "_last" "_N" "")
(command "_.pedit" na "_w" "0.0" "_x")
(command "_.pedit" "_last" "_N" "")

(command "_.pline")
(mapcar 'command pts_lst)
(command)
(command "_pline" loc "l" p1 "arc" "ce" loc "l" lseg "l" loc "")
(command "_pline" loc1 p1
"a" "r" rad p3
"l" p4 p5 p6 p7 p8 p9 p10 p11 p12
"a" "r" rad p14
"l" p15
"a" "r" rad p17
"l" p18 p19 p20 p21 p22 p23 p24 p25 p26
"a" "r" rad p28
"l" "cl" "")
(command "_pline" loc1 p1 p2 p3 p4 p5 p6 "c" "")
(command ".PLINE" ptll "W" "0" "0" ".X" ptur ".Y" ptll ptur ".X" ptll ".Y" ptur "C")
(command "_.PLINE" "0,0" (list 0 yl) (list xl yl) (list xl 0) "0,0" "_C")
(setq p1 (getvar "lastpoint"))
(command "_pline" p1 (setq px1 (polar p1 (+ ang (* pi 0.5)) wid2))
"a" (setq px2 (polar px1 (+ ang 0) spa2))
"l" (setq px3 (polar px2 (+ ang (* pi 1.5)) wid))
"a" (setq px4 (polar px3 (+ ang 0) spa2))
"l" (polar px4 (+ ang (* pi 0.5)) wid2) "")

(command "_plot") ; to know total setting
(command "-PLOT"
"YES" ; Detailed plot configuration?
"" ; Enter a layout name or [?] :
"Canon LBP-4" ; Printer type
"A4" ; Paper size
"Millimeters" ; Unit size
"Landscape" ; Model type
"N" ; Plot upside down?
"WINDOW" p1 p2 ; What to plot
"FIT" ; (Plotted Millimeters=Drawing Units) OR [Fit]
"CENTER" ; Enter plot offset (x,y) or [Center]
"YES" ; Plot with plot styles
"MONOCHROME" ; plot style table name
"YES" ; PLOT WITH LIGHWEIGHT
"As displayed" ; SHADE PLOT SETTING
"N" ; Write the plot to a file [Yes/No] :
"Y" ; Save changes to page setup [Yes/No]? y
"Y" ; Proceed with plot [Yes/No] :
) ; END command
(command "plot"
"y"
""
"Postscript File.pc3"
"User 1 (8.50 x 11.00 Inches)"
"i"
"l"
"n"
"e"
"f"
"c"
"y"
"ASC_RICOH_STYLE.ctb"
"y"
"y"
"y"
(strcat fil_path file_name "/model.eps")
"n"
"y")
(command "-plot" "yes" "" "Mainprinter.pc3" "A3" "" orientation
"" "" "" "" "" "" ""  "A3.ctb" "" "" "" "" "" "yes" "no" )
(command "plot" "Y" "MODEL" "LaserJet 5Si.pc3" fmtS "Inches" fmtr
"N" "W" pt1 pt2 "FIT" "center" "Y" "std.ctb" "Y" "N" "N" "N" "Y")

(command "point" ept "")

(command "_polygon" 6 loc "c" p1 "")
(command "polygon" sid ctrpt "C" p1)

(command "_.PSPACE")

(command "_purge" "la" lname "y" "y" "")

(command "_pasteclip" p1)


; Q
(command "_quit")

(command "qleader" p1 p2 p3 "0" txt "")

(command "_qsave")

; R
(command "_ray" sp ep "")

(command "_rectang" p1 p2 "")

(command "_redraw")

(command "_regen")

(command ".region" "w" w1 w2 "")

(command "_rename" "layer" "oldlayer" "newlayer")
(command "_.rename" "_block" tmp bna)

(if
(not (member "geom3d.arx" (arx)))
(arxload "geom3d")
)
(rprefs "TOGGLE" "SKIPDLG" "ON")

(command ".revolve" "w" w1 w2 "" L1 L2 360 "")
(command "revolve" "l" "" pt5 pt6 "")

(command "_.REVSURF" (list e2 ax) (list e1 cen) "" "")

(command "_rotate" ss1 "" loc "1")

(command "_rotate" ssn "" opt ang "")

(command "_rotate" "L" "" p3 "1")

(command "_.ROTATE" (entlast) "" pt1)

(command "_rotate" ss "" sp "r" 0 15 "")

(if (not (member "geom3d.arx" (arx)))
(arxload "geom3d"))
(rotate3d p4 "x" p3 "r" 0 90)

(command "_.RULESURF" (list e1 cen1) (list e2 cen2))


; S
(command "_saveas" "2000" new_file "")

(command "_SAVE" tempfile "y")
(command "_SAVE" tempfile)

(command "_scale" el "" loc scal "")
(command "_.SCALE" (entlast) "" "0,0" isc)

(setq path (getfiled "Select a dwg file" "" "scr" 0))
(command "_.script" path)

(setq ss (car (entsel "\nSelect a 3D object")))
(setq pt (getpoint "\nPick as base point: "))
(command "_section" ss "" "xy" pt "")

(command "_.SELECT" "_SI" "_AU" pause)

(command "_shademode" "g")

(command "shell" "del temp.tdf")

(command "slice" "l" "" pt1 pt3 pt1z pt5)

(command "_snap" "_on")

(command "solid" pt11 pt12 pt14 pt13 "")
(command "_.SOLID" "4.1,.1" "4.4,.1" "4.25,.25" "" "")

(command "_spline")
(foreach x npt
(command x)
)

(command "_stretch" "_C" pt1 pt2 "" bpt (list lngth (car bpt)) "")

(command "_style" stx stx "0" "1" "0" "N" "N" "N"))
(command "style" "romans" style name
"romans.shx" font file name
0 height
1 width factor
0 obliquing angle
"n" backwards
"n" upside down
"n" vertical)

(command "_subtract" p1 "" p2 "")

; T
(command "_style" "HELVETICABOLD" "hvbo.shx" "" "" "" "" "n" "n" "")

(command "_text" p5 th ang str2 "")
(command "_text" "j" "ml" loc 3 "0" str)
(command "_text" loc th "" str)
(command ".text" "_non" loc 0 str)
(command "_text" loc th "" str)
(Command "_text" "_j" "_m" px ts "0" txt)
(command "_text" "m" pt "0.05" "0" (strcat "%%" (rtos cnt 2 0)))
(command "_text" "m" sub_pt "0.05" "0" (rtos cnt 2 0))
(command "_text" "_midd" InsPnt "" NumVal)

(command "_trim" es8 es9 "" p22 "")
(command ".trim" "p" "l" "" TP1 TP2 "")
(command "TRIM" CE "")
(command "_.trim" (setq THETRIMLINE (entlast)) "" "f" ll ur "" "")
(command "_.trim" na "")

; U
(command "_ucs" "_p")
(command "ucs" "z" a3)
(command "ucs" "w")
(COMMAND "UCS" "3POINT" SP SPR SPA)
(COMMAND "UCS" "WORLD")
(command "_.UCS" "_x" "90")
(command "_.UCS" "_ZAXIS" cen ra)
(command "_ucsicon" "off")

(command "_.undefine" "line")

(defun c:adesu()
(setvar "CMDECHO" 0)
(command "_.line")
(setvar "CMDECHO" 1)
(princ)
) ; defun
(command "_.redefine" adesu)

(command "undo" "b")
(command "undo" "m")
(command "_.undo" "_end")
(command "_.undo" "_group")
(command "undo" "g")

(command "_union" p7 "")

(command "UNITS" 4 "16" "1" "0" "0" "N")

; V
(command "_viewres" "y" 10000 "")

(command "_.vplayer" "_freeze" "*" "_Current")

(command "_vpoint" "r" 275 35 "")


; W
(command "_WBLOCK" "block1" "" basepoint entname "")
(initdia)
(command "_.WBLOCK")
(command "_.wblock" (strcat "< >" (getvar "dwgname")) "*")
(command "wblock" "de" "" v0 sbl "" "erase" sbl "")
(command "wblock" "io" "" v0 sbl "" "erase" sbl "")
(command "wblock" "st" "" v0 sbl "" "erase" sbl "")

; X
(command "_xline" p1 p2 "")
(vl-cmdf "_xline" "b" inter-point p1 p2 "")
(command "_xline" "h" '(0 0 0) "")
(command "_xline" "a" 160 '(0 0 0) "")

(command "-xref" "p" (cdr (assoc 2 xrefedblock)) newpath)
(command "_.XREF" "_Path" bn (strcase (strcat bn ".DWG")))
(command "XREF" "Path" (cdr (assoc 2 xr_t)) xr_n)
(command "xref" "attach" (findfile uncommonblock) "0,0" "" "" "")
(command "_xref"
"a" ; attach
"trees-1-S300" ; trees-1-S300.dwg
sp ; start point
scale_factor ; scale_factor
angle_factor ; angle_factor
"" ;
0 ;
)
(command "_xref" "d" xref)
(command "-xref" "B" xr)
(command "-xref" "_overlay" "B.dwg" "0,0,0" "1" "" "0")
(command "-xref" "_detach" "A")

; Y

; Z
(command "_zomm" "v")
(command "_zoom" "e")
(command "_zoom" "a")
(command "_zoom" "d" "")
(command "ZOOM" "W" X1 X2)
(command "_.ZOOM" (strcat (mv_sts vp_scale) "xp"))