File: commands.html

package info (click to toggle)
pythoncad 0.1.23-1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 3,044 kB
  • ctags: 3,568
  • sloc: python: 54,867; sh: 100; makefile: 39
file content (348 lines) | stat: -rw-r--r-- 7,019 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="#internalStyle" type="text/css"?>
<!DOCTYPE html 
     PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>PythonCAD Command Interpreter</title>
<style type="text/css" id="internalStyle">
h1.center { text-align: center }
</style>
</head>
<body>
<h1 class="center">PythonCAD Command Interpreter Reference</h1>
<p>
The table below gives the available commands in PythonCAD. An
<a href="#example">example</a> of a command set like those in the
<q>keywords.py</q> file is available at the bottom of the page.
The commands are listed in the second column of the table. The third
column in the table represents an internal command that gets run
when the command in the second column is seen.
</p>
<p>
It bears repeating that the ability of PythonCAD in dealing with these
commands is a new feature, and therefore you should expect to encounter
some <q>undocumented features</q>. As the development of PythonCAD
advances, the command interpreting abilities of the program should
stabilize and become more powerful with fewer surprises.
</p>
<table border="1" cellpadding="0" cellspacing="0" width="90%">
 <tr>
  <td align="center" colspan="3"><strong>Command Interpreter (05/29/2003)</strong></td>
 </tr>
 <tr>
  <th>Command Description</th>
  <th>Default Name(s)</th>
  <th>Command Executed</th>
 </tr>
 <tr>
  <td>Draw Angled Construction Line</td>
  <td>acline,acl</td>
  <td>acline</td>
 </tr>
 <tr>
  <td>Arc(Radius/Angle)</td>
  <td>arc</td>
  <td>arcc</td>
 </tr>
 <tr>
  <td>Draw Construction Circle(Two Points)</td>
  <td>ccir2</td>
  <td>ccir2p</td>
 </tr>
 <tr>
  <td>Draw Construction Circle(Point/Radius)</td>
  <td>ccir</td>
  <td>ccircen</td>
 </tr>
 <tr>
  <td>Chamfer Object</td>
  <td>chamfer</td>
  <td>chamfer</td>
 </tr>
 <tr>
  <td>Draw Circle(Two Points)</td>
  <td>cir2</td>
  <td>cir2p</td>
 </tr>
 <tr>
  <td>Draw Circle(Point/Radius)</td>
  <td>cir</td>
  <td>circen</td>
 </tr>
 <tr>
  <td>Draw Construction Line (Two Points)</td>
  <td>cl</td>
  <td>cl</td>
 </tr>
 <tr>
  <td>Close Drawing Window</td>
  <td>close</td>
  <td>close</td>
 </tr>
 <tr>
  <td>Copy Object</td>
  <td>copy</td>
  <td>copy</td>
 </tr>
 <tr>
  <td>Cut Object</td>
  <td>cut</td>
  <td>cut</td>
 </tr>
 <tr>
  <td>Delete Object</td>
  <td>delete, del</td>
  <td>delete</td>
 </tr>
 <tr>
  <td>Open Dimension Prefrences Window</td>
  <td>dimpref</td>
  <td>dimpref</td>
 </tr>
 <tr>
  <td>Fillet Object</td>
  <td>fillet</td>
  <td>fillet</td>
 </tr>
 <tr>
  <td>Horizontal Construction Line</td>
  <td>hcline, hcl</td>
  <td>hcline</td>
 </tr>
 <tr>
  <td>Draw Leader (Multi-Point)</td>
  <td>leader, lead</td>
  <td>leader</td>
 </tr>
 <tr>
  <td>Mirror Object</td>
  <td>mirror, mir</td>
  <td>mirror</td>
 </tr>
 <tr>
  <td>Move Object</td>
  <td>move, mv</td>
  <td>move</td>
 </tr>
 <tr>
  <td>Move Object Horizontally</td>
  <td>moveh</td>
  <td>moveh</td>
 </tr>
 <tr>
  <td>Move Object Vertically</td>
  <td>movev</td>
  <td>movev</td>
 </tr>
 <tr>
  <td>Open New Window</td>
  <td>new</td>
  <td>new</td>
 </tr>
 <!--
 <tr>
  <td>Open Drawing in Window</td>
  <td>opend</td>
  <td>opend</td>
 </tr>
  -->
 <tr>
  <td>Paste Object</td>
  <td>paste</td>
  <td>paste</td>
 </tr>
 <tr>
  <td>Draw Perpendicular Construction Line</td>
  <td>pcline</td>
  <td>pcline</td>
 </tr>
 <tr>
  <td>Draw Point</td>
  <td>point</td>
  <td>point</td>
 </tr>
 <tr>
  <td>Draw Polyline (Multi-Point)</td>
  <td>polyline, pline</td>
  <td>polyline</td>
 </tr>
 <tr>
  <td>Open Prefrences Menu Window</td>
  <td>pref</td>
  <td>pref</td>
 </tr>
 <tr>
  <td>Quit Application</td>
  <td>quit</td>
  <td>quit</td>
 </tr>
 <tr>
  <td>Draw Rectangle (Two Points)</td>
  <td>rectangle, rect</td>
  <td>rect</td>
 </tr>
 <tr>
  <td>Redraw Screen Objects</td>
  <td>redraw</td>
  <td>redraw</td>
 </tr>
 <tr>
  <td>Refresh Screen Objects</td>
  <td>refresh, r</td>
  <td>refresh</td>
 </tr>
 <tr>
  <td>Select all: arcs</td>
  <td>saa</td>
  <td>saa</td>
 </tr>
 <tr>
  <td>Select all: angled construction lines</td>
  <td>saacl</td>
  <td>saacl</td>
 </tr>
 <tr>
  <td>Select all: circles</td>
  <td>sac</td>
  <td>sac</td>
 </tr>
 <tr>
  <td>Select all: construction circles</td>
  <td>sacc</td>
  <td>sacc</td>
 </tr>
 <tr>
  <td>Select all: construction lines</td>
  <td>sacl</td>
  <td>sacl</td>
 </tr>
 <tr>
  <td>Select all: horizontal construction lines</td>
  <td>sahcl</td>
  <td>sahcl</td>
 </tr>
 <tr>
  <td>Select all: polylines</td>
  <td>sap</td>
  <td>sap</td>
 </tr>
 <tr>
  <td>Select all: segments</td>
  <td>sas</td>
  <td>sas</td>
 </tr>
 <tr>
  <td>Select all: vertical construction lines</td>
  <td>savcl</td>
  <td>savcl</td>
 </tr>
 <tr>
  <td>Save Drawing as New Filename</td>
  <td>saveas</td>
  <td>saveas</td>
 </tr>
 <!--
 <tr>
  <td>Save Layer as New Filename</td>
  <td>savel</td>
  <td>savel</td>
 </tr>
 -->
 <tr>
  <td>Save Drawing</td>
  <td>saves, sv</td>
  <td>saves</td>
 </tr>
 <tr>
  <td>Draw Segment (Two Points)</td>
  <td>segment, seg, l</td>
  <td>segment</td>
 </tr>
 <tr>
  <td>Split Object</td>
  <td>split</td>
  <td>split</td>
 </tr>
 <tr>
  <td>Stretch Object (Two Points)</td>
  <td>str</td>
  <td>str</td>
 </tr>
 <tr>
  <td>Stretch Horizontal</td>
  <td>strh</td>
  <td>strh</td>
 </tr>
 <tr>
  <td>Stretch Vertical</td>
  <td>strv</td>
  <td>strv</td>
 </tr>
 <tr>
  <td>Draw Tangent Construction Line</td>
  <td>tcline, tcl</td>
  <td>tcline</td>
 </tr>
 <tr>
  <td>Input Text</td>
  <td>text</td>
  <td>text</td>
 </tr>
 <tr>
  <td>Transfer to Current Layer</td>
  <td>transfer</td>
  <td>transfer</td>
 </tr>
 <tr>
  <td>Draw Vertical Construction Line</td>
  <td>vcline, vcl</td>
  <td>vcline</td>
 </tr>
 <tr>
  <td>Zoom Default</td>
  <td>zoomd, z</td>
  <td>zoomd</td>
 </tr>
 <tr>
  <td>Zoom Fit</td>
  <td>zoomf, zf</td>
  <td>zoomf</td>
 </tr>
 <tr>
  <td>Zoom In</td>
  <td>zoomi, zi</td>
  <td>zoomi</td>
 </tr>
 <tr>
  <td>Zoom Out</td>
  <td>zoomo, zo</td>
  <td>zoomo</td>
 </tr>
</table>
<h4 id="example">Example Command Set</h4>
<p>
Defining a command set is essentially defining a Python dictionary. The
<q>key</q> is the command, and the <q>value</q> is the internal
command to execute when the user enters the command <q>key</q>. Here
is a commands set called <q>mycommands</q>.
</p>
<pre>
mycommands = {
	'foobar' : <q>quit</q>,
	'foo' : <q>segment</q>,
	'X' : <q>quit</q>,
	'O' : <q>opend</q>
}
</pre>
<p>
As the command interpreter is a new PythonCAD addition, it will undoubtedly
go through several iterations before it begins to stabilize. The command
set, internal command set, and means of selecting which dictionary to use
to try and interpret the commands are guaranteed to change. It is also
likely that commands may appear in one release, disappear in the next, then
reappear in the release after that, or that commands will change meanings.
</p>
</body>
</html>