Sunteți pe pagina 1din 18

2.

Apelarea comenzilor AutoCAD


2.1 Generaliti
AutoLISP este un limbaj proiectat i implementat pentru a permite automatizarea unor activiti n
utilizarea eficient a sistemului AutoCAD. Mecanismele de comunicare ntre interpretorul
AutoLISP i nucleul AutoCAD sunt:
a) conversaie direct - orice expresie AutoLISP furnizat promptului Command: determin
lansarea interpretorului AutoLISP pentru analiz i evaluare;
b) fiier de comenzi (program surs AutoLISP) expresiile sunt scrise ntr-un fiier text cu
extensia LSP i sunt ncrcate la nevoie.
Pentru realizarea unei bune interaciuni cu sistemul AutoCAD, AutoLISP dispune de funcii care
permit transmiterea de comenzi, comunicarea cu mediu extern i accesul la baza de date activ.
2.2 Funcia de comunicare COMMAD
Transmiterea comenzilor ctre AutoCAD, indiferent de modul de comunicare, se ralizeaz cu
ajutorul funciei COMMAND care are forma
(COMMAD arg1 arg2 ... ),
unde argumentle pot fi: nume de comand AutoCAD (arg1), nume de opiuni ale comenzilor
AutoCAD i valori de dialog cerute de sistemul AutoCAD. Rezultatul returnat de funcie este
ntotdeauna NIL. Dac comanda nu are argumente suficiente, sistemul AutoCAD solicit
argumentele lips prin dialog la promptul Command. n exemplul urmtor se dorete trasarea de
segmente folosind funcia AutoLISP COMMAD care s activeze comanda AutoCAD LIE.
Command: (command "LINE")
LINE From point: nil

Punctele prin care trec segmentele se vor introduce de la tastatur. De asemenea, pentru introducere
manual, se poate utiliza (command "line" pause) sau (command "line" "\\") care au acelai efect.
Pentru specificarea complet i corect a unui apel COMMAD trebuie cunoscute foarte
bine comenzile AutoCAD mpreun cu toate opiunile acestora. Primul argument eronat al funciei
command va antrena o cascad de erori, dac argumentul urmtor nu este o corecie a celui eronat.
Pn la urm, secvena (command "lie" "line" '(100 100) '(200 200) "") se va finaliza corect, dup
cum rezult din dialogul:
lie Unknown command "LIE". Press F1 for help.
Command: line From point:
To point:
To point:
Command: nil

Argumentele pot fi trimise prin mai multe apeluri COMMAND, dar numai n programe AutoLISP
stocate n fiiere LSP i ncrcate n sesiunea curent de lucru.
2.3 Antrenamente AutoLISP - 2
2.3.1. Comenzi pentru desenare
n aceast subseciune, urmnd ordinea din [2], se vor exersa comenzile: LINE, RAY, XLINE,
MLINE, CIRCLE, ARC, PLINE, POLYGON, RECTANG, DONUT, SPLINE, ELLIPSE i

POINT. Exersai conform modelelor prezentate n rundele urmtoare (pe baza textului nclinat
italic). Observai i reinei variantele posibile de utilizare.
a) Comanda LIE n AutoLISP desenarea de linii simple
Prima rund: [Apelul fr argumente]
Pentru apelul (command "LINE") se iniiaz dialogul [from point, to point , ... ] cu utilizatorul.
Runda a II-a: [Trasarea unui segment opiunea "" ENTER]
(command "LINE" '(100 0 0) '(200 100 0) "")
nil

Observai irul vid "" pentru a indica terminarea mulimii de puncte (similar cu apsarea tastei
ENTER).
Runda a III-a: [Trasarea unui ptrat folosind opiunea "c" close.]
(command "line" (list 100 0 0) (list 100 100 0) (list 200 100 0) (list 200 0 0) "c")
line From point:
To point:
To point:
To point:
To point: c
nil

Runda a IV-a: [n anumite situaii trebuie renunat la un punct introdus i considerat urmtorul. Se
va opta pentru soluia "u" undo.]
(command "line" (list 300 100 0) (list 300 0 0) "u" (list 400 100 0) "")
line From point:
To point:
To point: u
nil

b) Comanda RAY n AutoLISP trasarea de raze1 (semidrepte de construcie) prin acelai punct
Prima rund: [Evantai de raze dintr-un punct specificat. Utilizatorul va introduce punctele dorite,
iar n final va apsa ENTER.]
(command "ray" (list 200 0 0))
ray From point:
Through point: nil

Runda a II-a: [Raz prin dou puncte specificate]


(command "ray" (list 100 100 0) (list 400 400 0) "")
nil

Runda a III-a: [Dou semidrepte de construcie]


(command "ray" (list 200 200 0) (list 200 400 0) (list 400 200 0) "")
ray From point:
nil

c) Comanda XLINE n AutoLISP trasarea dreptelor ajuttoare2


Prima rund: [From Point prin puncte specificate]
(command "xline" (list 200 200 0) (list 150 100 0) "")
xline Hor/Ver/Ang/Bisect/Offset/<From point>:
nil

Runda a II-a: [Hor pe orizontal]


(command "xline" "H" (list 100 500 0) (list 100 400 0) (list 100 300 0) "")
xline Hor/Ver/Ang/Bisect/Offset/<From point>: H
nil

Runda a III-a: [Ver pe vertical]


(command "xline" "v" (list 100 0 0) (list 200 0 0) (list 300 0 0) "")
xline Hor/Ver/Ang/Bisect/Offset/<From point>: v

nil

Runda a IV-a: [Ang oblic. Primul test specific unghiul de 45 de grade, iar al doilea o referin
obinut ca ultim entitate i specificarea unghiului relativ la aceasta.]
Primul test:
(command "xline" "a" 45 (list 100 0 0) (list 200 0 0) "")
xline Hor/Ver/Ang/Bisect/Offset/<From point>: a
Reference/<Enter angle (0)>: 45
nil

Al doilea test:
(command "line" (list 100 0 0) (list 100 200 0) "")
nil
(setq ent (entlast))
<Entity name: 1ad0500>
(command "xline" "a" "r" ent 20 (list 400 0 0) (list 500 0 0) "")
xline Hor/Ver/Ang/Bisect/Offset/<From point>: a
Reference/<Enter angle (0)>: r
Select a line object:
Enter angle <0>: 20
nil

Runda a V-a: [Bisect crearea a cel puin unei x-linii care trece prin primul punct specificat i este
bisectoare unghiului, determinat de dreapta format de primele dou puncte i de cea format de
primul i urmtorul punct]
Primul test:
(command "xline" "b" (list 100 100 0) (list 100 400 0) (list 400 100 0) "")
xline Hor/Ver/Ang/Bisect/Offset/<From point>: b
nil

Al doilea test:
(command "xline" "b" (list 200 200 0) (list 200 400 0) (list 400 200 0) (list 400 300 0) (list 400 100 0) "")
xline Hor/Ver/Ang/Bisect/Offset/<From point>: b
nil

Runda a VI-a: [Offset creeaz o linie paralel la o anumit distan fa de obiectul linie selectat.]
Primul test:
(command "line" (list 100 100 0) (list 100 200 0) "")
nil
(setq ent (entlast))
<Entity name: 1ad0500>
(command "xline" "o" 100 ent (list 200 100 0) "")
xline Hor/Ver/Ang/Bisect/Offset/<From point>: o
Offset distance or Through <100.0000>: 100
Select a line object:
Side to offset?
Select a line object:
nil

Al doilea test:
(command "xline" "o" "t" ent (list 400 100 0) "")
xline Hor/Ver/Ang/Bisect/Offset/<From point>: o
Offset distance or Through <100.0000>: t
Select a line object:
Through point:
Select a line object:
nil

d) Comanda MLINE n AutoLISP desenare de linii care simbolizeaz grosimi3. Comanda


MLEDIT.
Prima rund: [Multilinie prin puncte date. Observai prezena opiunilor "u" i "c" care au fost deja
exersate n cadrul comenzii LINE]
(command "mline" (list 100 100 0) (list 100 200 0) (list 200 200 0) (list 200 100 0) "c")
mline
Justification = Top, Scale = 20.00, Style = STANDARD
Justification/Scale/STyle/<From point>:

<To point>:
Undo/<To point>:
Close/Undo/<To point>:
Close/Undo/<To point>: c
nil

Runda a II-a: [Controlul apariiei multiliniei: J/S/ST]


(command "mline" "j" "t" "s" 40 "st" "standard" (list 100 100 0) (list 100 200 0) (list 200 200 0) (list 200 100 0)
"c")
mline
Justification = Top, Scale = 40.00, Style = STANDARD
Justification/Scale/STyle/<From point>: j
Top/Zero/Bottom <top>: t
Justification = Top, Scale = 40.00, Style = STANDARD
Justification/Scale/STyle/<From point>: s
Set Mline scale <40.00>: 40
Justification = Top, Scale = 40.00, Style = STANDARD
Justification/Scale/STyle/<From point>: st
Mstyle name (or ?): standard
Justification = Top, Scale = 40.00, Style = STANDARD
Justification/Scale/STyle/<From point>:
<To point>:
Undo/<To point>:
Close/Undo/<To point>:
Close/Undo/<To point>: c
nil

Runda a III-a: [Comanda MLEDIT permite modificarea i combinarea multiliniilor (rezolvarea


interseciilor, tratarea frngerilor, tratarea discontinuitilor etc.)]
(command "mline" (list 100 100 0) (list 100 200 0) (list 200 200 0) (list 200 100 0) "c")
(command "mledit")

e) Comanda CIRCLE n AutoLISP trasarea cercurilor


Prima rund: [Comanda fr argumente declaneaz dialogul uzual.]
(command "circle")
circle 3P/2P/TTR/<Center point>: nil
3P/2P/TTR/<Center point>: 300,300
Diameter/<Radius>: 100

Runda a II-a: [Cerc specificat prin centrul i raza sa]


(command "circle" (list 200 200 0) 100)
circle 3P/2P/TTR/<Center point>: Diameter/<Radius> <100.0000>: 100
nil

Runda a III-a: [Cerc specificat prin centrul i diametrul su]


(command "circle" (list 400 100 0) "d" 200)
circle 3P/2P/TTR/<Center point>: Diameter/<Radius> <100.0000>: d Diameter
<200.0000>: 200
nil

Runda a IV-a: [3P Cerc specificat prin trei puncte necoliniare]


(command "circle" "3P" (list 200 0 0) (list 400 0 0) (list 300 200 0))
circle 3P/2P/TTR/<Center point>: 3P First point:
Second point:
Third point:
nil

Runda a V-a: [2P Cerc specificat prin dou puncte "diametral opuse"]
(command "circle" "2P" (list 300 0 0) (list 400 0 0))
circle 3P/2P/TTR/<Center point>: 2P First point on diameter:
Second point on diameter:
nil

f) Comanda ARC n AutoLISP trasarea arcelor de cerc


Prima rund: [Arc specificat prin trei puncte: start, interior, sfrit]
(command "arc" (list 200 0 0) (list 300 100 0) (list 200 200 0))

arc Center/<Start point>:


Center/End/<Second point>:
End point:
nil

Runda a II-a: [Arc specificat prin centru, punct iniial i punct final]
(command "arc" "c" (list 150 150 0) (list 150 0 0) (list 200 200 0))
arc Center/<Start point>: c Center:
Start point:
Angle/Length of chord/<End point>:
nil

Runda a III-a: [Arc specificat prin centru, punct iniial i unghi la centru]
(command "arc" "c" (list 200 200 0) (list 200 100 0) "a" 45)
arc Center/<Start point>: c Center:
Start point:
Angle/Length of chord/<End point>: a Included angle: 45
nil

Runda a IV-a: [Arc specificat prin centru, punct iniial i lungimea coardei]
(command "arc" "c" (list 300 300 0) (list 300 100 0) "L" 100)
arc Center/<Start point>: c Center:
Start point:
Angle/Length of chord/<End point>: L Length of chord: 100
nil

Runda a V-a: [Arc specificat prin punct iniial, centru, unghi/lungimea coardei]
(command "arc" (list 300 100 0) "c" (list 300 300 0) "a" 90)
arc Center/<Start point>:
Center/End/<Second point>: c Center:
Angle/Length of chord/<End point>: a Included angle: 90
nil
(command "arc" (list 300 100 0) "c" (list 300 300 0) "L" 100)
arc Center/<Start point>:
Center/End/<Second point>: c Center:
Angle/Length of chord/<End point>: L Length of chord: 100
nil

Runda a VI-a: [Arc specificat prin punct iniial, punct final i unghi]
(command "arc" (list 300 300 0) "e" (list 300 400 0) "a" 45)
arc Center/<Start point>:
Center/End/<Second point>: e
End point:
Angle/Direction/Radius/<Center point>: a Included angle: 45
nil

Runda a VII-a: [Arc specificat prin punct iniial, punct final i direcia fa de punctul iniial]
(command "arc" (list 200 200 0) "e" (list 300 300 0) "d" 120)
arc Center/<Start point>:
Center/End/<Second point>: e
End point:
Angle/Direction/Radius/<Center point>: d Direction from start point: 120
nil

Runda a VIII-a: [Arc specificat prin punct iniial, punct final i raz]
(command "arc" (list 100 100 0) "e" (list 200 300 0) "r" 150)
arc Center/<Start point>:
Center/End/<Second point>: e
End point:
Angle/Direction/Radius/<Center point>: r Radius: 150
nil

Runda a IX-a: [Arc specificat prin punct iniial, punct final i centru]
(command "arc" (list 100 200 0) "e" (list 200 200 0) (list 150 150 0))
arc Center/<Start point>:
Center/End/<Second point>: e
End point:
Angle/Direction/Radius/<Center point>:
nil

g) Comanda PLINE n AutoLISP trasarea unei entiti formate din linii i arce de cerc
Pentru exersarea comenzii PLINE sunt necesare foarte multe etape. Exist opiuni la nivelul unui
segment de dreapt, dar i la nivelul unui arc de cerc. Orice polilinie are un punct de start. Ceea ce
urmeaz este un segment de dreapt sau un arc, acestea putnd fi amestecate la nevoie. O polilinie
poate fi i nchis (opiunea Close). Ultimul segment sau arc de cerc poate face obiectul unei aciuni
Undo.
Prima rund: [Polilinie compus numai din segmente de aceeai grosime]
Primul test: [Polilinie deschis]
(command "pline" (list 100 0 0) (list 200 0 0) (list 200 200 0) "")
pline
From point:
Current line-width is 0.0000
Arc/Close/Halfwidth/Length/Undo/Width/<Endpoint of line>:
Arc/Close/Halfwidth/Length/Undo/Width/<Endpoint of line>:
Arc/Close/Halfwidth/Length/Undo/Width/<Endpoint of line>:
nil

Al doilea test: [Polilinie nchis]


(command "pline" (list 300 0 0) (list 400 0 0) (list 200 200 0) "c")
pline
From point:
Current line-width is 0.0000
Arc/Close/Halfwidth/Length/Undo/Width/<Endpoint of line>:
Arc/Close/Halfwidth/Length/Undo/Width/<Endpoint of line>:
Arc/Close/Halfwidth/Length/Undo/Width/<Endpoint of line>: c
nil

Runda a II-a: [Polilinie compus din arce de cerc. Se pot utiliza opiuni variate n specificarea
arcelor de cerc. A se vedea i comanda ARC]
Primul test: [Polilinie deschis]
(command "pline" (list 300 100 0) "a" (list 400 200 0) (list 500 300 0) "")
pline
From point:
Current line-width is 0.0000
Arc/Close/Halfwidth/Length/Undo/Width/<Endpoint of line>: a
Angle/CEnter/CLose/Direction/Halfwidth/Line/Radius/Second pt/Undo/Width/
<Endpoint of arc>:
Angle/CEnter/CLose/Direction/Halfwidth/Line/Radius/Second pt/Undo/Width/
<Endpoint of arc>:
Angle/CEnter/CLose/Direction/Halfwidth/Line/Radius/Second pt/Undo/Width/
<Endpoint of arc>:
nil

Al doilea test: [Polilinie nchis]


(command "pline" (list 100 100 0) "a" (list 100 200 0) (list 100 300 0) "cl")
pline
From point:
Current line-width is 0.0000
Arc/Close/Halfwidth/Length/Undo/Width/<Endpoint of line>: a
Angle/CEnter/CLose/Direction/Halfwidth/Line/Radius/Second pt/Undo/Width/
<Endpoint of arc>:
Angle/CEnter/CLose/Direction/Halfwidth/Line/Radius/Second pt/Undo/Width/
<Endpoint of arc>:
Angle/CEnter/CLose/Direction/Halfwidth/Line/Radius/Second pt/Undo/Width/
<Endpoint of arc>: cl
nil

Runda a III-a: [Polilinie compus din entiti (linii i arce) combinate]


(command "pline" '(200 100 0) '(400 100 0) "a" '(400 200 0) "l" '(200 200 0) "a" "cl")
pline
From point:
Current line-width is 0.0000
Arc/Close/Halfwidth/Length/Undo/Width/<Endpoint of line>:
Arc/Close/Halfwidth/Length/Undo/Width/<Endpoint of line>: a
Angle/CEnter/CLose/Direction/Halfwidth/Line/Radius/Second pt/Undo/Width/

<Endpoint of arc>:
Angle/CEnter/CLose/Direction/Halfwidth/Line/Radius/Second pt/Undo/Width/
<Endpoint of arc>: l
Arc/Close/Halfwidth/Length/Undo/Width/<Endpoint of line>:
Arc/Close/Halfwidth/Length/Undo/Width/<Endpoint of line>: a
Angle/CEnter/CLose/Direction/Halfwidth/Line/Radius/Second pt/Undo/Width/
<Endpoint of arc>: cl
nil

Runda a IV-a: [Dimensionarea poliliniilor: Width/Halfwidth/Length]


Primul test: [Width limea liniilor/ Similar pentru Halfwidh]
(command "pline" (list 100 100 0) "w" 10 5 (list 200 100 0) "w" 5 12 (list 300 300 0) "w" 12 1 (list 400 100 0) "")
pline
From point:
Current line-width is 0.0000
Arc/Close/Halfwidth/Length/Undo/Width/<Endpoint of line>: w
Starting width <0.0000>: 10
Ending width <10.0000>: 5
Arc/Close/Halfwidth/Length/Undo/Width/<Endpoint of line>:
Arc/Close/Halfwidth/Length/Undo/Width/<Endpoint of line>: w
Starting width <5.0000>: 5
Ending width <5.0000>: 12
Arc/Close/Halfwidth/Length/Undo/Width/<Endpoint of line>:
Arc/Close/Halfwidth/Length/Undo/Width/<Endpoint of line>: w
Starting width <12.0000>: 12
Ending width <12.0000>: 1
Arc/Close/Halfwidth/Length/Undo/Width/<Endpoint of line>:
Arc/Close/Halfwidth/Length/Undo/Width/<Endpoint of line>:
nil

Al doilea test: [Width - Limea arcelor / Similar pentru Halfwidth]


(command "pline" (list 100 100 0) "w" 10 5 "a" (list 100 200 0) "w" 5 12 (list 100 300 0) "w" 12 1 (list 100 400 0)
"")
pline
From point:
Current line-width is 0.0000
Arc/Close/Halfwidth/Length/Undo/Width/<Endpoint of line>: w
Starting width <0.0000>: 10
Ending width <10.0000>: 5
Arc/Close/Halfwidth/Length/Undo/Width/<Endpoint of line>: a
Angle/CEnter/CLose/Direction/Halfwidth/Line/Radius/Second pt/Undo/Width/
<Endpoint of arc>:
Angle/CEnter/CLose/Direction/Halfwidth/Line/Radius/Second pt/Undo/Width/
<Endpoint of arc>: w
Starting width <5.0000>: 5
Ending width <5.0000>: 12
Angle/CEnter/CLose/Direction/Halfwidth/Line/Radius/Second pt/Undo/Width/
<Endpoint of arc>:
Angle/CEnter/CLose/Direction/Halfwidth/Line/Radius/Second pt/Undo/Width/
<Endpoint of arc>: w
Starting width <12.0000>: 12
Ending width <12.0000>: 1
Angle/CEnter/CLose/Direction/Halfwidth/Line/Radius/Second pt/Undo/Width/
<Endpoint of arc>:
Angle/CEnter/CLose/Direction/Halfwidth/Line/Radius/Second pt/Undo/Width/
<Endpoint of arc>:
nil

Al treilea test: [Lungimea segmentelor cu pstrarea direciei. Iniial se folosete AGBASE1]


Primul ncercare: [AGBASE = 0; valoarea implicit]
(command "pline" (list 100 100 0) "l" 100 (list 300 300 0) "")
pline
From point: Current line-width is 0.0000
Arc/Close/Halfwidth/Length/Undo/Width/<Endpoint of line>: l
Length of line: 100
Arc/Close/Halfwidth/Length/Undo/Width/<Endpoint of line>:
Arc/Close/Halfwidth/Length/Undo/Width/<Endpoint of line>:
nil
1

ANGBASE Variabil a sistemului AutoCAD (a se vedea lucrarea nr. 17)

A doua ncercare: [AGBASE = 45; folosind SETVAR]


(setvar "angbase" 45)
45
(command "pline" (list 100 100 0) "l" 100 (list 300 300 0) "")
pline
From point:
Current line-width is 0.0000
Arc/Close/Halfwidth/Length/Undo/Width/<Endpoint of line>: l
Length of line: 100
Arc/Close/Halfwidth/Length/Undo/Width/<Endpoint of line>:
Arc/Close/Halfwidth/Length/Undo/Width/<Endpoint of line>:
nil

h) Comanda POLYGON n AutoLISP trasarea poligoanelor regulate


Prima rund: [Specificarea poligonului regulat prin: numr de laturi, centrul cercului nscris i raza
acestuia poligon circumscris unui cerc imaginar]
(command "polygon" 5 (list 300 200 0) "C" 100)
polygon Number of sides <5>: 5
Edge/<Center of polygon>:
Inscribed in circle/Circumscribed about circle (I/C) <I>: C
Radius of circle: 100
nil

Runda a II-a: [Specificarea poligonului regulat prin: numr de laturi, centrul cercului circumscris i
raza acestuia poligon nscris ntr-un cerc imaginar]
(command "polygon" 6 (list 400 200 0) "I" 100)
polygon Number of sides <5>: 6
Edge/<Center of polygon>:
Inscribed in circle/Circumscribed about circle (I/C) <C>: I
Radius of circle: 100
nil

Runda a III-a: [Specificarea poligonului prin numrul laturilor i dou puncte care desemneaz
prima latur a poligonului]
(command "polygon" 6 "e" (list 200 200 0) (list 300 200 0))
polygon Number of sides <4>: 6
Edge/<Center of polygon>: e First endpoint of edge: Second endpoint of edge:
nil

i) Comenzile RECTANG i DONUT n AutoLISP trasarea dreptunghiurilor i a discurilor


Prima rund: [Comanda RECTANG Elevation/Thickness/Width/Fillet se pstreaz pentru
comenzile urmtoare]
Primul test: [Dreptunghi definit prin puncte elevaie implicit]
(command "rectang" (list 100 0 0) (list 400 200 0))
rectang
Chamfer/Elevation/Fillet/Thickness/Width/<First corner>:
Other corner:
nil

Al doilea test: [Dreptunghi definit prin elevaie i coluri]


(command "rectang" "e" 50 (list 100 0 0) (list 400 200 0))
rectang
Chamfer/Elevation/Fillet/Thickness/Width/<First corner>: e
Elevation for rectangles <10.0000>: 50
Chamfer/Elevation/Fillet/Thickness/Width/<First corner>:
Other corner:
nil

Folosii Modify/Properties pentru a vedea coordonatele vrfurilor dreptunghiului trasat n cadrul


celui de-al doilea test.
Al treilea test: [Dreptunghi cu linii groase]
(command "rectang" "w" 10 (list 200 200 0) (list 400 100 0))
rectang

Chamfer/Elevation/Fillet/Thickness/Width/<First corner>: w
Width for rectangles <10.0000>: 10
Chamfer/Elevation/Fillet/Thickness/Width/<First corner>:
Other corner:
nil

Al patrulea test: [Dreptunghiuri teite]


(command "rectang" "c" 10 30 (list 300 300 0) (list 500 400 0))
rectang
Chamfer/Elevation/Fillet/Thickness/Width/<First corner>: c
First chamfer distance for rectangles <10.0000>: 10
Second chamfer distance for rectangles <30.0000>: 30
Chamfer/Elevation/Fillet/Thickness/Width/<First corner>:
Other corner:
nil

Al cincilea test: [Dreptunghiuri cu colurile rotunjite]


(command "rectang" "f" 10 (list 100 100 0) (list 300 200 0))
rectang
Chamfer/Elevation/Fillet/Thickness/Width/<First corner>: f
Fillet radius for rectangles <10.0000>: 10
Chamfer/Elevation/Fillet/Thickness/Width/<First corner>:
Other corner:
nil

Al aselea test: [Suprafee dreptunghiulare groase]


(command "rectang" "t" 10 (list 300 300 0) (list 500 100 0))
rectang
Chamfer/Elevation/Fillet/Thickness/Width/<First corner>: t
Thickness for rectangles <20.0000>: 10
Chamfer/Elevation/Fillet/Thickness/Width/<First corner>:
Other corner:
nil

Runda a II-a [Comanda DONUT]


(command "donut" 5 20 (list 100 100 0) (list 200 100 0) (list 200 200 0) (list 100 200 0) "")
donut
Inside diameter <10.0000>: 5
Outside diameter <20.0000>: 20
Center of doughnut:
Center of doughnut:
Center of doughnut:
Center of doughnut:
Center of doughnut:
nil

j) Comanda SPLINE n AutoLISP pentru curbe de interpolare/aproximare spline de tip NURBS


Prima rund: [Curb spline printr-o mulime de puncte tangentele implicite]
(command "spline" (list 100 0 0) (list 200 100 0) (list 300 0 0) "" "" "")
spline
Object/<Enter first point>:
Enter point:
Close/Fit Tolerance/<Enter point>:
Close/Fit Tolerance/<Enter point>:
Enter start tangent:
Enter end tangent:
nil

Runda a II-a: [Curb spline printr-o mulime de puncte tangentele explicite n primul i ultimul
punct]
(command "spline" '(100 100 0) '(200 200 0) '(300 100 0) "" '(50 100 0) '(350 100 0))
spline
Object/<Enter first point>:
Enter point:
Close/Fit Tolerance/<Enter point>:
Close/Fit Tolerance/<Enter point>:
Enter start tangent: Enter end tangent:
nil

Runda a III-a [Curb spline nchis opiunea Close; se va specifica tangenta la curb n punctul de
start]
(command "spline" '(100 100 0) '(200 200 0) '(300 100 0) "c" '(100 50 0))
spline
Object/<Enter first point>:
Enter point:
Close/Fit Tolerance/<Enter point>: Close/Fit Tolerance/<Enter point>: c
Enter tangent:
nil

Runda a IV-a [Curbe spline de interpolare (tolerana = 0) versus curbe spline de aproximare
(tolerana 0) Opiunea Fit Tolerance]
Primul test: [Curb spline de interpolare precum cele din rundele anterioare]
(command "spline" '(200 100 0) '(300 200 0) "f" 0 '(400 100 0) "" "" "")
spline
Object/<Enter first point>:
Enter point:
Close/Fit Tolerance/<Enter point>: f
Enter Fit tolerance <0.0000>: 0
Close/Fit Tolerance/<Enter point>:
Close/Fit Tolerance/<Enter point>:
Enter start tangent: Enter end tangent:
nil

Al doilea test: [Curb spline de aproximare toleran pozitiv]


(command "spline" '(200 100 0) '(300 200 0) "f" 50 '(400 100 0) "" "" "")
spline
Object/<Enter first point>:
Enter point:
Close/Fit Tolerance/<Enter point>: f
Enter Fit tolerance <0.0000>: 50
Close/Fit Tolerance/<Enter point>:
Close/Fit Tolerance/<Enter point>:
Enter start tangent: Enter end tangent:
nil

Runda a V-a: [Transformarea unei polilinii editate ca Spline n entitate spline: iniial generm o
polilinie, utilizm comanda PEDIT cu opiunea Spline, apoi comanda SPLINE cu optiunea Object.]
(command "pline" '(100 100 0) '(200 200 0) '(300 100 0) '(400 200 0) "")
(setq e1 (entlast))
(command "pedit" e1 "s" "")
(command "spline" "o" e1 "")
spline
Object/<Enter first point>: o
Select objects to convert to splines.
Select objects: 1 found
Select objects:
nil

k) Comenzile ELLIPSE i POINT n AutoLISP trasarea elipselor i a punctelor izolate.


Prima rund: [Trasarea unei elipse definit printr-o ax (dou puncte) i lungimea celeilalte
semiaxe]
Primul test: [Lungimea este dat prin valoare numeric]
(command "ellipse" '(200 200 0) '(400 200 0) 50)
ellipse
Arc/Center/<Axis endpoint 1>:
Axis endpoint 2:
<Other axis distance>/Rotation: 50
nil

Al doilea test: [Lungimea rezult prin calcul, folosind centrul elipsei i punctul specificat]
(command "ellipse" '(200 200 0) '(400 200 0) '(300 25 0))
ellipse
Arc/Center/<Axis endpoint 1>: Axis endpoint 2:
<Other axis distance>/Rotation:
nil

Runda a II-a: [ Elips definit prin centru vrful unei semiaxe i lungimea celeilalte semiaxe]
Primul test: [Lungimea este specificat numeric]
(command "ellipse" "c" '(300 300 0) '(300 100 0) 100)
ellipse
Arc/Center/<Axis endpoint 1>: c
Center of ellipse:
Axis endpoint:
<Other axis distance>/Rotation: 100
nil

Al doilea test: [Lungimea rezult ca distan dintre centru i un punct auxiliar]


(command "ellipse" "c" '(300 300 0) '(300 100 0) '(300 200 0))
ellipse
Arc/Center/<Axis endpoint 1>: c
Center of ellipse:
Axis endpoint:
<Other axis distance>/Rotation:
nil

Runda a III-a: [Trasarea unei elipse prin specificarea raportului dintre axa mare i axa mic: intre 0
i 89.4; valoarea zero definete un cerc, iar cu ct este mai mare valoarea specificat cu att este mai
mare raportul dintre axa mic i axa mare]
(command "ellipse" '(100 100 0) '(300 0 0) "R" 50)
ellipse
Arc/Center/<Axis endpoint 1>:
Axis endpoint 2:
<Other axis distance>/Rotation: R
Rotation around major axis: 50
nil
(command "ellipse" '(100 100 0) '(300 0 0) "R" 80)
ellipse
Arc/Center/<Axis endpoint 1>:
Axis endpoint 2:
<Other axis distance>/Rotation: R
Rotation around major axis: 80
nil

Runda a IV-a: [Trasarea unui arc eliptic]


Primul test: [Specificarea elipsei la care aparine arcul, a punctului de start i a punctului final - date
prin unghiuri n raport cu centrul elipsei]
(command "ellipse" "a" '(300 100 0) '(500 100 0) 100 120 45)
ellipse
Arc/Center/<Axis endpoint 1>: a
<Axis endpoint 1>/Center:
Axis endpoint 2:
<Other axis distance>/Rotation: 100
Parameter/<start angle>: 120
Parameter/Included/<end angle>: 45
nil

Al doilea test: [Specificarea elipsei la care aparine arcul, a punctului de start i a punctului final date prin coordonate]
(command "ellipse" "a" '(300 100 0) '(500 100 0) 100 '(300 100 0) '(500 100 0))
ellipse
Arc/Center/<Axis endpoint 1>: a
<Axis endpoint 1>/Center:
Axis endpoint 2:
<Other axis distance>/Rotation: 100
Parameter/<start angle>:
Parameter/Included/<end angle>:
nil

Al treilea test: [Specificarea elipsei la care aparine arcul, a punctului de start i a punctului final date prin parametrul unghiular]
(command "ellipse" "a" "c" '(200 200 0) '(400 200 0) '(300 300 0) "p" 0 120)
ellipse
Arc/Center/<Axis endpoint 1>: a
<Axis endpoint 1>/Center: c
Center of ellipse:

Axis endpoint:
<Other axis distance>/Rotation:
Parameter/<start angle>: p
Angle/<start parameter>: 0
Angle/Included/<end parameter>: 120
nil

Al patrulea test: [Specificarea elipsei la care aparine arcul, a punctului de start i a punctului final date prin unghiul inclus]
(command "ellipse" "a" "c" '(200 200 0) '(400 200 0) '(300 300 0) "p" 180 "i" 70)
ellipse
Arc/Center/<Axis endpoint 1>: a
<Axis endpoint 1>/Center: c
Center of ellipse:
Axis endpoint:
<Other axis distance>/Rotation:
Parameter/<start angle>: p
Angle/<start parameter>: 180
Angle/Included/<end parameter>: i
Included parameter <90>: 70
nil

Runda a V-a: [Definirea punctelor]


Primul test: [Punct n coordonate absolute]
(command "point" (list 200 200 100))
point Point:
nil

Al doilea test: [Punct n coordonate relative]


(command "point" "@100,0, 0")
point Point: @100,0, 0
nil

Al treilea test: [Punct n coordonate polare]


(command "point" "@100<45")
point Point: @100<45
nil

Al patrulea test: [Punct n coordonate sferice]


(command "point" "@100<45<-45")
point Point: @100<45<-45
nil

Oriunde se cerea un punct, n testele de mai sus, acesta se putea specifica n modurile artate n
cadrul rundei a cincea.
2.3.2. Comenzi pentru editare
n aceast subseciune se vor exersa comenzile: COPY, MOVE, MIRROR, ROTATE, SCALE,
OFFSET, ARRAY, STRETCH, TRIM, EXTENDED, BREAK, CHAMFER, FILLET i ERASE.
S-a observat, mai sus, utilizarea funciei entlast care furnizeaz codul ultimei entiti trasate.
Acest cod, depus ntr-o variabil (folosind funcia LISP setq), poate fi folosit n comenzi AutoCAD
sau alte funcii AutoLISP. Deoarece comenzile de editare necesit selectarea entitilor ce urmeaz
a fi modificate, aceast funcie va fi utilizat destul de des.
n cele ce urmeaz nu va mai fi redat i dialogul din fereastra text special, ci numai ceea ce
scrie utilizatorul. Exersai conform modelelor prezentate n rundele urmtoare (pe baza textului
nclinat italic). Observai i reinei!
Se traseaz dou entiti (o polilinie e1; o linie e2) i se creeaz mulimea de selecie
set1. Aceast mulime este copiat ntr-o alt locaie prin specificarea punctului de referin iniial i
a celui final. Observai utilizarea funciei LISP ssadd care creeaz o mulime de selecie prin
inserarea de entiti. Secvena AutoLISP este urmtoarea:
(command "pline" '(100 100 0) '(100 200 0) '(200 200 0) "")
(setq e1 (entlast))
(command "line" '(200 100 0) '(300 100 0) "")

(setq e2 (entlast))
(setq set1 (ssadd e1))
(ssadd e2 set1)

a) Utilizarea comenzii COPY n AutoLISP copierea obiectelor


Se presupune c mulimea set1 este deja constituit. Comanda COPY se utilizeaz precum n
apelul:
(command "copy" set1 "" '(100 100 0) '(400 100 0))

Se pot realiza i copii multiple, dup cum observai din secvena:


(command "circle" '(200 200 0) 50)
(setq e1 (entlast))
(command "copy" e1 "" "m" '(100 100 0) '(200 100 0) '(300 100 0) '(200 200 0) '(300 200 0) "")

b) Utilizarea comenzii MOVE n AutoLISP mutarea obiectelor


Se presupune c mulimea set1 este deja constituit. Comanda MOVE se utilizeaz precum n
apelul:
(command "move" set1 "" '(100 100 0) '(500 300 0))

c) Utilizarea comenzii MIRROR n AutoLISP - oglindire


Se presupune c mulimea set1 este deja constituit. Comanda MIRROR se utilizeaz precum n
testele urmtoare:
Primul test: [Oglindire cu pstrarea entitilor iniiale]
(command "mirror" set1 "" '(200 100 0) '(200 200 0) "N")

Al doilea test: [Oglindire cu tergerea entitilor iniiale]


(command "mirror" set1 "" '(200 100 0) '(200 200 0) "Y")

d) Utilizarea comenzii ROTATE n AutoLISP rotire


Se presupune c mulimea set1 este deja constituit. Comanda ROTATE ia n considerare valorile
stocate n variabilele ANGBASE i ANGDIR (a se vedea lucrarea nr. 17). Ea se utilizeaz precum
n apelul:
(command "rotate" set1 "" '(200 200 0) 45)

Rotaia se poate specifica i prin opiunea Reference precum n exemplul:


(command "rotate" set1 "" '(100 100 0) "r" 45 90)

e) Utilizarea comenzii SCALE n AutoLISP scalare uniform


Se presupune c mulimea set1 este deja constituit. Comanda SCALE se utilizeaz precum n
apelul:
(command "scale" set1 "" '(100 100 0) 0.5)

De asemenea, scalarea se poate specifica i prin opiunea Reference precum n exemplul:


(command "scale" set1 "" '(100 100 0) "r" 2 5)

f) Utilizarea comenzii OFFSET n AutoLISP contururi decalate paralel


Exersai dup modelul:
(command "pline" '(100 100 0) '(200 200 0) '(300 100 0) '(400 300 0) "")
(setq e1 (entlast))
(command "offset" 20 e1 '(110 100 0) "")

g) Utilizarea comenzii ARRAY n AutoLISP copierea regulat a obiectelor


Primul test: [Copierea tabelar prin specificarea numrului rndurilor i a numrului coloanelor]
Deschidei un nou desen i introducei secvena urmtoare. Observai aranjarea pe 4 rnduri i 2
coloane a obiectelor grupate n set.
(command "circle" '(60 60 0) 50)
(setq e1 (entlast))

(command "line" '(60 0 0) '(60 120 0) "")


(setq e2 (entlast))
(command "line" '(0 60 0) '(120 60 0) "")
(setq e3 (entlast))
(setq set (ssadd e1))
(ssadd e2 set)
(ssadd e3 set)
(command "array" set "" "r" 4 2 150 150)

Al doilea test : [Copierea circular Se specific centrul polar, numrul de copii i unghiul la centru
care va fi acoperit.]
(command "array" set "" "p" '(200 200 0) 5 -270 "y")

h) Utilizarea comenzii STRETCH n AutoLISP alungirea i deformarea obiectelor


Deschidei un nou desen i introducei, la promptul Command, urmtoarele apeluri:
(command "line" '(100 100 0)
(command "line" '(300 100 0)
(command "line" '(250 150 0)
(command "line" '(200 150 0)

'(300 100 0) "")


'(250 150 0) "")
'(200 150 0) "")
'(200 250 0) "")

(command "line" '(200 250 0) '(250 250 0)


(command "line" '(250 250 0) '(300 300 0)
(command "line" '(300 300 0) '(100 300 0)
(command "line" '(100 300 0) '(100 100 0)

"")
"")
"")
"")

Selectarea entitilor supuse unor operaii de editare se poate face i prin utilizarea opiunilor:
Window (fereastr dreptunghiular) /Last (ultima entitate) /Crossing (traversare fereastrei
dreptunghiulare) /BOX (box) /ALL (totul) /Fence /WPolygon (fereastr poligonal) /CPolygon
(traversarea ferestrei poligonale) /Group (dintr-un grup) /Add (adaugare la set) /Remove (eliminare
din set) /Multiple (puncte multiple) /Previous (anterior) /AUto (automatic) /SIngle (unic obiect).
Observai cteva dintre aceste posibiliti n testele care urmeaz.
Primul test: [Deformare prin selectarea entitilor folosind opiunea "Crossing"]
(command "stretch" "c" '(350 350 0) '(300 50 0) "" '(100 100 0) '(250 150 0))
stretch
Select objects to stretch by crossing-window or crossing-polygon...
Select objects: c
First corner: Other corner: 4 found
Select objects:
Base point or displacement:
Second point of displacement:
nil

Al doilea test: [Deplasare-deformare prin selectarea entitilor folosind opiunea "Window"]


(command "stretch" "w" '(350 350 0) '(105 50 0) "" '(100 100 0) '(250 150 0))
stretch
Select objects to stretch by crossing-window or crossing-polygon...
Select objects: w
First corner: Other corner: 5 found
Select objects:
Base point or displacement:
Second point of displacement:
nil

Al treilea test: [Deformare prin selectarea entitilor folosind opiunea "BOX"]


(command "stretch" "box" '(350 350 0) '(105 50 0) "" '(100 100 0) '(250 150 0))
stretch
Select objects to stretch by crossing-window or crossing-polygon...
Select objects: box
First corner: Other corner: 7 found
Select objects:
Base point or displacement:
Second point of displacement:
nil

Al patrulea test: [Stretch ca transformare de forfecare asupra unui ptrat]


(command "line" '(100 100 0) '(200 100 0) '(200 200 0) '(100 200 0) "c")
(command "stretch" "box" '(350 350 0) '(105 50 0) "" '(200 200 0) '(300 300 0))

i) Utilizarea comenzii TRIM n AutoLISP retezarea obiectelor


Elementele definitorii ale comenzii sunt: setul obiectelor "tioase"i setul obiectelor de retezat.
Exersai dup urmtorul model:
(command "line" '(100 100 0) '(300 300 0) "")
(setq e1 (entlast))
(command "line" '(300 300 0) '(200 300 0) "")
(setq e2 (entlast))
(command "line" '(200 300 0) '(200 100 0) "")
(setq e3 (entlast))
(command "trim" e3 "" e1 "")

j) Utilizarea comenzii EXTENDED n AutoLISP extinderea obiectelor


Deschidei un nou desen i introducei apelurile.
(command "line" '(100 50 0) '(300 100 0) "")
(setq e1 (entlast))
(command "line" '(100 100 0) '(300 250 0) "")
(setq e2 (entlast))
(command "line" '(300 250 0) '(350 110 0) "")
(setq e3 (entlast))
(command "arc" '(200 300 0) '(360 100 0) '(200 50 0))
(setq e4 (entlast))
(command "extend" e4 "" e1 e2 e3 "")

Ce ai observat? Folosii comanda Undo pentru a anula comanda extend tocmai executat. Reluai
comanda Extend (comand AutoCAD) de la promptul Command. Fii atent la selectarea obiectelor.
Aceast comand utilizeaz informaia din variabilele EDGEMODE i PROJMODE.
k) Utilizarea comenzii BREAK n AutoLISP ruperea obiectelor
Uneori este util ca o entitate (linia, polilinia sau arcul de cerc) s fie "rupt" n mai multe pri, prin
eliminarea de poriuni. Exersai dup modelul:
(command "line" '(100 100 0) '(400 100 0) "")
(command "break" "last" '(200 100 0) '(300 100 0))
(command "arc" '(200 300 0) '(300 200 0) '(100 200 0))
(command "break" "last" '(300 200 0) '(200 100 0))

l) Utilizarea comenzii CHAMFER n AutoLISP teirea colurilor


Comanda CHAMFER are mai multe opiuni. Doar o parte dintre acestea vor fi exersate aici
(Atenie la utilizarea comenzii UDO). Pentru aceast comand sunt importante variabilele de
sistem: CHAMFERA, CHAMFERB, CHAMFERC, CHAMFERD i TRIMMODE.
Exersai conform apelurilor de mai jos i urmrii dialogul asociat (aici este prezentat doar
selectiv):
(command "line" '(100 200 0) '(200 200 0) "")
(setq e1 (entlast))
(command "line" '(250 100 0) '(250 175 0) "")
(setq e2 (entlast))
(command "chamfer" e1 e2)
chamfer
(TRIM mode) Current chamfer Dist1 = 10.0000, Dist2 = 10.0000
Polyline/Distance/Angle/Trim/Method/<Select first line>:
Select second line:
nil
(command "undo" 1)
(command "chamfer" "d" 20 30)
chamfer
(TRIM mode) Current chamfer Dist1 = 20.0000, Dist2 = 10.0000
Polyline/Distance/Angle/Trim/Method/<Select first line>: d Enter first chamfer
distance <10.0000>: 20 Enter second chamfer distance <20.0000>: 30
nil
(command "chamfer" e1 e2)
(command "undo" 2)
(command "pline" '(300 200 0) '(350 200 0) "a" '(400 150 0) '(300 100 0) "")

(setq e3 (entlast))
(command "chamfer" e2 e3)
chamfer
(TRIM mode) Current chamfer Dist1 = 20.0000, Dist2 = 30.0000
Polyline/Distance/Angle/Trim/Method/<Select first line>:
Select second line:
nil

m) Utilizarea comenzii FILLET n AutoLISP racordarea colurilor folosind arce de cerc. Racordul
se poate realiza cu/fr retezare
Deschidei un nou desen i exersai, observnd i dialogul, dup modelul:
(command "line" '(100 100 0) '(100 200 0) "")
(setq e1 (entlast))
(command "line" '(250 100 0) '(250 150 0) "")
(setq e2 (entlast))
(command "line" '(150 250 0) '(200 250 0) "")
(setq e3 (entlast))
(command "fillet" e1 e3)
fillet
(TRIM mode) Current fillet radius = 10.0000
Polyline/Radius/Trim/<Select first object>:
Select second object:
nil
(command "undo" 1)
undo Auto/Control/BEgin/End/Mark/Back/<Number>: 1 FILLET GROUP
nil
(command "fillet" "r" 20)
fillet
(TRIM mode) Current fillet radius = 10.0000
Polyline/Radius/Trim/<Select first object>: r Enter fillet radius <10.0000>: 20
nil
(command "fillet" e1 e3)
fillet
(TRIM mode) Current fillet radius = 20.0000
Polyline/Radius/Trim/<Select first object>:
Select second object:
nil
(command "fillet" e2 e3)

Raza curent a arcului de racordare este stocat n variabila FILLETRAD.


n) Utilizarea comenzii ERASE n AutoLISP tergerea obiectelor grafice
Deschidei un nou desen, introducei apelurile de mai jos (se vor desena dou entiti, se vor afia
proprietile comanda LIST , iar apoi se vor terge) i urmrii detaliile:
(command "pline" '(100 100 0) '(200 200 0) '(200 100 0) "a" '(300 200 0) '(350 150 0) "l" '(100 50 0) "cl")
(setq e1 (entlast))
(command "list" e1 "")
list
Select objects: 1 found
Select objects:
LWPOLYLINE Layer: 0
Space: Model space
Handle = 20
Closed
Constant width 0.0000
at point X= 100.0000 Y= 100.0000 Z= 0.0000
at point X= 200.0000 Y= 200.0000 Z= 0.0000
at point X= 200.0000 Y= 100.0000 Z= 0.0000
bulge 2.4142
center X= 300.0000 Y= 100.0000 Z= 0.0000
radius 100.0000
start angle
180
end angle
90
at point X= 300.0000 Y= 200.0000 Z= 0.0000
bulge 2.4142
center X= 300.0000 Y= 150.0000 Z= 0.0000
radius 50.0000
start angle
90

end angle
0
at point X= 350.0000 Y= 150.0000 Z= 0.0000
at point X= 100.0000 Y= 50.0000 Z= 0.0000
(command "arc" '(100 100 0) '(300 300 0) '(400 100 0))
(setq e2 (entlast))
(command "list" e2 "")
list
Select objects: 1 found
Select objects:
ARC
Layer: 0
Space: Model space
Handle = 21
center point, X= 250.0000 Y= 150.0000 Z= 0.0000
radius 158.1139
start angle 342
end angle 198
length 598.4759
(command "erase" e1 e2 "")
erase
Select objects: 1 found
Select objects: 1 found
Select objects:
nil

2.4 Exerciii propuse


1. Exersai toate opiunile permise de comenzile utilizate n seciunea 16.3.
2. Stabilirea culorii curente se poate realiza, din AutoLISP, cu apeluri de forma (command "\'color"
...) sau (command "color" ...). Exersai astfel de apeluri.
3. Comanda elev este utilizat pentru a stabili elevaia (eng. elevation; coordonata Z implicit) i
nlimea (eng. thickness) entitii. Entitile pentru care parametrul thickness este nenul sunt
numite entiti 2D. Scriei apelul (command ... ) pentru a fixa elevaia la valoarea 10 i nimea la
valoarea 5.
4 Trasarea de polilinii 3D formate numai cu linii (nu i cu arce) se realizeaz folosind comanda
AutoCAD 3dpoly, disponibil i n AutoLISP. Completai apelul (command "3dpoly" ...) pentru a
trasa o polilinie 3D nchis definit prin cel puin cinci puncte.
5. Studiai dialogul:
Command: (command "box" '(200 200 200) '(400 300 100))
box
Center/<Corner of box> <0,0,0>:
Cube/Length/<other corner>:
Command: nil

Un paralelipiped poate fi specificat prin colurile opuse. Exist i alte posibiliti de specificare.
Scriei apelurile (command "box" ... ) pentru a studia i celelalte opiuni. Folosii comanda
AutoCAD render pentru generarea 3D a obiectului.
6. Studiai dialogul:
(command "cylinder" '(100 100 100) 50 200)
cylinder
Elliptical/<center point> <0,0,0>:
Diameter/<Radius>: 50
Center of other end/<Height>: 200
nil

Exersai apeluri similare pentru parcurgerea tuturor modurilor de specificare a corpurilor de tip
cilindru. Folosii comanda AutoCAD render pentru a vedea obiecte spaiale redate n manier
realist.
7. Alte primitive 3D permise de AutoLISP, sunt: conul (COE), sfera (SPHERE), torul (TORUS)
i pana (WEDGE). Sunt permise de AutoCAD (comanda 3D), dar nu i de AutoLISP, primitivele:
farfuria semisferic (DISH), cupola semisferic (DOME), suprafaa reea (MESH) i piramida
(PYRAMID).
Studiai apelurile:
(command "cone" '(200 200 200) 50 100) con definit prin centrul bazei, raz i nlime;

sfer definit prin centru i raz;


(command "torus" '(300 200 100) 100 50) tor definit prin centrul i raza torului i, raza tubului;
(command "wedge" '(100 100 100) '(50 200 300)) pan definit prin dou puncte care dau i dimensiunile
acesteia.
Scriei apelurile (command ... ) pentru a studia i celelalte opiuni utile n definirea
primitivelor 3D permise de AutoLISP.
8. Comanda AutoCAD 3dface permite crearea unei suprafee mrginit de trei sau patru linii n
spaiul 3D. Comanda este permis i de AutoLISP. Studiai apelul:
(command "sphere" '(200 200 100) 100)

(command "3dface" '(200 200 200) '(200 100 200) '(100 100 200) '(100 200 200) '(100 200 100) '(100 100 100) "")
9. Dup modelul (command "solid" '(200 100 100) '(200 200 100) '(200 100 200) '(200 200 200) "") creai i

alte
obiecte. Indicarea punctelor se face ncruciat. Dac punctele 3 i 4 coincid atunci suprafaa este un
triunghi.
10. Suprafaa de tip reea (colecie de petice) se obine prin comanda 3dmesh disponibil i n
AutoLISP. Studiai apelul: (command "3dmesh" 4 2 '(0 0 100) '(0 50 100) '(50 0 120) '(50 50 110) '(100 0 50) '(100
100 75) '(150 0 100) '(150 150 110)) i utilizai View/3D Dynamic View /CAmera pentru a vedea
suprafaa definit. Aplicai render pentru a genera o imagine solid.
11. Dac avei conexiune la INTERNET atunci putei accesa situl dorit, din programe AutoLISP,
ntr-o fereastr nou, conform modelului:
(command "browser" "http://www.uoradea.ro")
browser Location <http://www.autodesk.com/acaduser>: http://www.uoradea.ro
nil

Exersai aceast facilitate.


12. Realizai o list a comenzilor AutoCAD, acceptate de AutoLISP, dar neexersate nc.
2.5 Bibliografie
1. Grigore Albeanu, Programarea i utilizarea calculatoarelor, Editura Universitii din Oradea, 2003.
2. Mircea Bdu, AutoCAD-ul n trei timpi. Ghidul proiectrii profesionale. Editura POLIROM, 2004.
3. Dumitru Dragomir, Proiectare asistat de calculator pentru inginerie mecanic, Teora, 1996.
2.6 ote finale
1
Razele se folosesc ca elemente auxiliare i nu pentru a modela entiti reale. Se recomand ca toate razele s fie
plasate pe un strat distinct pentru a putea fi uor ascunse. Pentru schie pseudo-3D, razele sunt utile pentru redarea
perspectivei spaiale.
2
Aceste linii sunt utile pentru realizarea planurilor-etaj, n arhitectur, sau la redarea reelelor de tip meridiane/paralele
din anumite reprezentri.
3
Se utilizeaz pentru a reda obiecte liniare pe poriuni, dar cu grosime (ziduri/perei, garduri, dumuri etc.) simbolizate
n desen prin dou linii paralele.

S-ar putea să vă placă și