forked from JonathanHandojo/Sample-LISP-Routines-for-AutoCAD
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCurveDistance.lsp
More file actions
518 lines (510 loc) · 30.6 KB
/
CurveDistance.lsp
File metadata and controls
518 lines (510 loc) · 30.6 KB
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
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; ;;;
;;; ------------------------------------------------------------ ;;;
;;; CurveDistance.lsp ;;;
;;; Created by Jonathan Handojo ;;;
;;; ------------------------------------------------------------ ;;;
;;; ;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; ;;;
;;; This routine provides a tool to provide a rough measurement within a curve at any point. ;;;
;;; Upon executing the CRVDIS command, the user will be prompted the selection of any open ;;;
;;; curve. Following this selection, the program will proceed to show a real time distance ;;;
;;; from the start and end points to the current cursor position as the mouse cursor is moved. ;;;
;;; Optionally, the user may specify points by left clicking to mark positions at any point on ;;;
;;; the curve. ;;;
;;; ;;;
;;; The distance provided is the actual distance from the start of the curve to wherever the ;;;
;;; point is along the curve. Distances shown in magenta denotes the distance between each of ;;;
;;; the consecutive points behind and ahead. Following the selection, the start and end points ;;;
;;; of the curve will be marked, and any additional markers can be placed with the prefix 'p' ;;;
;;; followed by a number that is incremented each time the user clicks to place a marker along ;;;
;;; the curve. ;;;
;;; ;;;
;;; Credits to Lee Mac for the GrText Function to perform visual display of the text. ;;;
;;; ;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; ;;;
;;; Versions and Updates ;;;
;;; ------------------------------------------------------------ ;;;
;;; ;;;
;;; Version 1.0 (06/10/21) - First Release ;;;
;;; ;;;
;;; ;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun c:crvdis (/ *error* acadobj activeundo adoc clp crv dis dst ep est gr grp grv i len lnk msp pl pm sp vcrv)
(defun *error* (msg)
(redraw)
(vla-EndUndoMark adoc)
(if (not (wcmatch (strcase msg T) "*break*,*cancel*,*exit*"))
(princ (strcat "Error: " msg))
)
)
(setq acadobj (vlax-get-acad-object)
adoc (vla-get-ActiveDocument acadobj)
msp (vla-get-ModelSpace adoc)
activeundo nil
)
(if (= 0 (logand 8 (getvar "UNDOCTL")))
(vla-StartUndoMark adoc)
(setq activeundo T)
)
(while
(progn
(setq crv (car (entsel "\nSelect any open curve <exit>: ")))
(cond
( (= (getvar 'errno) 7) (princ "\nNothing selected"))
( (null crv) nil)
( (not (vl-position (cdr (assoc 0 (entget crv))) '("LINE" "LWPOLYLINE" "ARC" "SPLINE")))
(princ "\nObject is not a curve")
)
( (progn
(setq vcrv (vlax-ename->vla-object crv))
(or
(equal (vlax-curve-getStartPoint crv) (vlax-curve-getEndPoint crv) 1e-7)
(and
(vlax-property-available-p vcrv 'closed)
(eq (vla-get-Closed vcrv) :vlax-true)
)
)
)
(princ "\nObject is a closed curve")
)
)
)
)
(if crv
(progn
(setq
len (vlax-curve-getDistAtParam crv (vlax-curve-getEndParam crv))
pl (list
(list "Start" (trans (vlax-curve-getStartPoint crv) 0 1) 0.0)
(list "End" (trans (vlax-curve-getEndPoint crv) 0 1) len)
)
sp (vlax-curve-getStartPoint crv)
ep (vlax-curve-getEndPoint crv)
i 0
)
(princ "\nSpecify point to place marker <exit>: ")
(while
(progn
(setq gr (grread t 15 2) grp (last gr) grv (car gr))
(cond
( (member grv '(5 3))
(redraw)
(setq
clp (vlax-curve-getClosestPointTo crv (trans grp 1 0))
pm (vlax-curve-getParamAtPoint crv clp)
dst (vlax-curve-getDistAtParam crv pm)
est (- len dst)
xd (* 8 (/ (getvar 'viewsize) (cadr (getvar 'screensize))))
-xd (- xd)
)
(foreach x pl
(LM:DisplayGrText (cadr x) (LM:GrText (car x)) acYellow 6 6)
(grvecs
(list -5
(mapcar '+ (cadr x) (list xd xd))
(mapcar '+ (cadr x) (list -xd -xd))
(mapcar '+ (cadr x) (list -xd xd))
(mapcar '+ (cadr x) (list xd -xd))
)
)
)
(mapcar
'(lambda (a b)
(LM:DisplayGrText
(trans (vlax-curve-getPointAtDist crv (* 0.5 (+ (caddr b) (caddr a)))) 0 1)
(LM:GrText (rtos (- (caddr b) (caddr a)) 2 2))
acMagenta 6 6
)
)
pl
(cdr pl)
)
(setq dis (vlax-curve-getDistAtPoint crv clp))
(LM:DisplayGrText grp
(LM:GrText
(CurveDistance:lst->str
(mapcar
'(lambda (x)
(strcat
"Distance from " (car x) ": "
(rtos
(abs
(-
dis
(caddr x)
)
)
2 2
)
)
)
pl
)
"\n"
)
)
acYellow 7 -20
)
(LM:DisplayGrText grp
(LM:GrText
(strcat
"Distance from Cursor to Curve: "
(rtos (distance (trans grp 1 0) clp) 2 3)
)
)
acMagenta 7 10
)
(grvecs
(list
-3
grp (setq clp (trans clp 0 1))
-1
(mapcar '+ clp (list xd xd))
(mapcar '+ clp (list -xd -xd))
(mapcar '+ clp (list -xd xd))
(mapcar '+ clp (list xd -xd))
-6
(mapcar '+ grp (list xd xd))
(mapcar '+ grp (list -xd -xd))
(mapcar '+ grp (list -xd xd))
(mapcar '+ grp (list xd -xd))
)
)
(and
(= grv 3)
(setq pl
(vl-sort
(append pl (list (list (strcat "p" (itoa (setq i (1+ i)))) clp (vlax-curve-getDistAtPoint crv (trans clp 1 0)))))
'(lambda (a b)
(< (caddr a) (caddr b))
)
)
)
)
t
)
( (or
(vl-position gr '((2 32) (2 13)))
(= grv 25)
)
nil
)
(t)
)
)
)
(redraw)
(redraw crv)
)
)
(if activeundo nil (vla-EndUndoMark adoc))
(princ)
)
;; CurveDistance:lst->str --> Jonathan Handojo
;; Concatenates a list of string into one string with a specified delimeter
;; lst - list of strings
;; del - delimiter string
(defun CurveDistance:lst->str (lst del)
(apply 'strcat (append (list (car lst)) (mapcar '(lambda (x) (strcat del x)) (cdr lst))))
)
;;-----------------------=={ GrText }==-----------------------;;
;; ;;
;; Returns a grvecs pixel vector list relative to the origin ;;
;; encoding the supplied string. ;;
;;------------------------------------------------------------;;
;; Author: Lee Mac, Copyright © 2013 - www.lee-mac.com ;;
;;------------------------------------------------------------;;
;; With thanks to ElpanovEvgeniy for the method of vector ;;
;; encoding to save me a lot of typing. ;;
;;------------------------------------------------------------;;
;; Arguments: ;;
;; str - String to be expressed in vector list format. ;;
;;------------------------------------------------------------;;
;; Returns: GrVecs Pixel Vector List relative to the Origin ;;
;;------------------------------------------------------------;;
;; Version 1.1 - 26-03-2011 ;;
;;------------------------------------------------------------;;
(defun LM:GrText ( str / asc lst vec xco yco )
(setq vec
'(
(033 045 045 065 135)
(034 104 134 107 137)
(035 043 063 046 066 084 094 087 097 115 135 118 138 072 078 103 109)
(036 025 035 052 052 043 047 058 078 083 087 092 112 123 127 118 118 135 135)
(037 052 052 063 063 074 074 085 085 096 096 107 107 118 118 129 129 047 048 067 068 056 056 059 059 113 114 133 134 122 122 125 125)
(038 043 046 049 049 052 072 057 058 067 068 076 076 079 079 083 083 085 085 094 094 103 123 134 136 127 127)
(039 105 135)
(040 017 017 026 036 045 105 116 126 137 137)
(041 014 014 025 035 046 106 115 125 134 134)
(042 073 074 076 077 084 086 092 098 104 106 113 114 116 117)
(043 055 115 082 084 086 088)
(044 034 035 045 046 055 057)
(045 083 088)
(046 045 046 055 056)
(047 052 052 063 063 074 074 085 085 096 096 107 107 118 118 129 129)
(048 044 047 134 137 053 123 058 128)
(049 044 048 124 125 056 136)
(050 043 048 053 053 064 064 075 075 086 086 097 097 108 128 134 137 123 123)
(051 053 053 044 047 058 088 095 097 108 128 134 137 123 123)
(052 046 048 057 137 078 078 073 076 083 083 094 094 105 115 126 126)
(053 053 053 044 047 058 088 094 097 093 133 134 138)
(054 044 047 058 088 095 097 084 084 053 113 124 124 135 137)
(055 044 054 065 075 086 096 107 117 128 138 133 137 123 123)
(056 044 047 094 097 134 137 053 083 058 088 103 123 108 128)
(057 044 046 057 057 068 128 097 097 084 086 134 137 093 123)
(058 045 046 055 056 095 096 105 106)
(059 034 035 045 046 055 057 095 096 105 106)
(060 047 047 056 056 065 065 074 074 083 083 094 094 105 105 116 116 127 127)
(061 073 078 093 098)
(062 043 043 054 054 065 065 076 076 087 087 096 096 105 105 114 114 123 123)
(063 045 045 065 075 086 086 097 097 108 128 134 137 123 123)
(064 034 038 043 043 052 112 123 123 134 137 128 128 079 119 068 068 065 066 105 106 077 107 074 094)
(065 041 043 047 049 052 062 058 068 073 077 083 093 087 097 104 114 106 116 125 135 133 134)
(066 042 047 053 123 058 088 108 128 094 097 132 137)
(067 044 047 053 053 058 058 062 112 123 123 134 136 127 127 108 138)
(068 042 046 057 057 127 127 132 136 068 118 053 123)
(069 042 048 058 058 094 095 086 106 132 137 128 138 053 123)
(070 042 045 094 095 086 106 132 137 128 138 053 123)
(071 044 047 053 053 058 078 086 089 062 112 123 123 134 136 127 127 108 138)
(072 041 043 047 049 131 133 137 139 093 097 052 122 058 128)
(073 043 047 133 137 055 125)
(074 052 062 043 046 057 127 135 139)
(075 042 044 048 049 132 134 136 138 053 123 084 085 095 095 106 116 127 127 076 076 067 067 058 058)
(076 042 047 048 058 053 123 132 135)
(077 041 043 047 049 052 122 058 128 131 132 138 139 103 113 107 117 084 094 086 096 065 075)
(078 041 044 131 132 136 139 052 122 048 128 113 113 094 104 085 085 066 076 057 057)
(079 044 046 053 053 057 057 123 123 127 127 134 136 062 112 068 118)
(080 042 045 084 087 132 137 053 123 098 128)
(081 134 136 123 123 127 127 112 062 118 068 053 053 057 057 044 046 035 036 023 024 027 028)
(082 042 044 048 049 132 137 123 053 128 098 084 087 076 076 067 067 058 058)
(083 042 062 053 053 044 047 058 078 086 087 093 095 102 122 133 136 127 127 118 138)
(084 043 047 055 125 132 138 131 121 139 129)
(085 044 046 052 053 057 058 062 122 068 128 131 133 137 139)
(086 045 055 064 074 066 076 083 103 087 107 112 122 118 128 131 133 137 139)
(087 043 063 047 067 072 092 074 094 076 096 078 098 101 121 105 115 109 129 131 132 138 139)
(088 041 043 047 049 131 133 137 139 052 052 058 058 063 063 067 067 074 074 076 076 085 095 104 104 106 106 113 113 117 117 122 122 128 128)
(089 043 047 055 085 094 094 096 096 103 113 107 117 122 122 128 128 131 133 137 139)
(090 122 122 058 058 132 138 042 048 128 128 052 052 063 063 074 074 085 095 106 106 117 117)
(091 015 017 135 137 025 125)
(092 122 122 113 113 104 104 095 095 086 086 077 077 068 068 059 059)
(093 014 016 134 136 026 126)
(094 102 102 113 113 124 124 135 135 126 126 117 117 108 108)
(095 021 029)
(096 125 125 134 134)
(097 043 046 048 048 052 072 057 097 083 086 103 106)
(098 042 043 045 046 054 054 057 058 068 098 097 097 105 106 094 094 132 132 053 133)
(099 044 046 053 053 057 058 052 092 093 093 104 106 097 098 108 108)
(100 044 045 047 048 052 092 053 053 056 056 093 093 104 105 096 096 136 136 057 137)
(101 044 046 053 053 057 058 052 092 093 093 104 106 097 098 088 088 073 078)
(102 043 046 054 124 093 093 095 096 135 137 128 128)
(103 013 016 022 032 027 097 107 108 066 066 096 096 054 055 104 105 063 063 093 093 062 092)
(104 042 044 046 048 057 097 053 133 132 132 094 094 105 106)
(105 043 047 055 105 103 104 135 135)
(106 022 022 013 015 026 106 104 105 136 136)
(107 042 044 046 048 053 133 132 132 057 057 066 066 074 075 085 085 096 106 107 108)
(108 043 047 055 135 133 134)
(109 041 043 045 046 048 049 052 102 055 105 058 108 101 101 093 093 104 104 096 096 107 107)
(110 042 044 046 048 053 103 057 097 102 102 094 094 105 106)
(111 044 046 104 106 053 053 057 057 093 093 097 097 052 092 058 098)
(112 012 015 023 103 102 102 054 054 094 094 045 046 105 106 057 058 097 098 068 088)
(113 015 018 027 107 108 108 056 056 096 096 044 045 104 105 052 053 092 093 062 082)
(114 042 046 054 104 102 103 095 095 106 108 099 099)
(115 052 052 043 047 058 068 073 077 082 092 103 107 098 098)
(116 045 047 058 058 054 124 102 103 105 107)
(117 102 102 106 106 053 103 056 056 044 045 047 107 048 048)
(118 045 045 054 064 056 066 073 083 077 087 092 092 098 098 101 103 107 109)
(119 043 053 047 057 062 092 064 084 066 086 068 098 101 103 095 105 107 109)
(120 042 044 046 048 102 104 106 108 053 053 057 057 093 093 097 097 064 064 066 066 084 084 086 086 075 075)
(121 012 013 024 024 035 045 054 064 056 066 073 083 077 087 092 092 098 098 101 103 107 109)
(122 092 092 058 058 102 108 042 048 097 097 086 086 075 075 064 064 053 053)
(123 016 017 025 065 073 074 085 125 136 137)
(124 015 135)
(125 014 015 026 066 077 078 086 126 134 135)
(126 112 122 133 134 125 125 116 117 128 138)
(145 114 116 125 126 136 137)
(146 114 115 125 126 135 137)
(161 045 115 135 135)
(162 026 036 045 047 058 058 054 054 053 093 094 094 098 098 105 107 116 126)
(163 043 048 054 074 083 086 094 094 103 123 134 136 117 127)
(164 083 083 088 088 133 133 138 138 094 097 124 127 104 114 107 117)
(165 044 046 055 075 081 089 094 094 096 096 101 103 107 109 113 113 117 117 122 122 128 128 131 133 137 139)
(166 015 055 095 135)
(167 042 042 032 036 047 047 056 057 065 065 074 074 083 083 092 102 068 078 087 087 096 096 105 105 113 114 123 123 134 138 128 128)
(168 134 134 137 137)
(169 054 057 063 063 068 068 072 122 079 129 133 133 138 138 144 147 075 076 087 087 084 114 125 126 117 117)
(170 063 067 084 086 088 088 093 103 097 127 114 116 134 136)
(171 055 055 064 064 073 073 082 082 093 093 104 104 115 115 058 058 067 067 076 076 085 085 096 096 107 107 118 118)
(172 068 098 092 097)
(173 083 088)
(174 054 057 063 063 068 068 072 122 079 129 133 133 138 138 144 147 074 124 095 096 125 126 077 087 107 117)
(175 151 159)
(176 105 106 114 124 117 127 135 136)
(177 042 048 092 098 065 085 105 125)
(178 084 087 095 095 106 106 117 127 135 136 124 124)
(179 094 094 085 086 097 107 116 116 127 127 135 136 124 124)
(180 125 125 136 136)
(181 012 012 023 113 044 047 049 049 058 118)
(182 045 045 049 049 048 128 046 126 133 139 122 125 112 115 102 105 092 095 083 085)
(183 085 086 095 096)
(184 014 015 026 026 035 035)
(185 084 086 124 124 095 135)
(186 063 067 084 086 134 136 093 123 097 127)
(187 052 052 063 063 074 074 085 085 094 094 103 103 112 112 055 055 066 066 077 077 088 088 097 097 106 106 115 115)
(188 048 098 059 059 055 057 065 065 076 076 087 087 083 133 122 122 052 052 063 063 074 074 085 085 096 096 107 107 118 118 129 129)
(189 046 049 057 057 068 068 079 089 097 098 086 086 083 133 122 122 052 052 063 063 074 074 085 085 096 096 107 107 118 118 129 129)
(190 048 098 059 059 055 057 065 065 076 076 087 087 092 092 083 084 095 105 114 114 125 125 133 134 122 122 052 052 063 063 074 074 085 085 096 096 107 107 118 118 129 129)
(191 044 047 058 058 053 073 084 084 095 095 106 116 136 136)
(192 041 043 047 049 052 062 058 068 073 077 083 093 087 097 104 114 106 116 125 135 133 134 155 155 164 164)
(193 041 043 047 049 052 062 058 068 073 077 083 093 087 097 104 114 106 116 125 135 133 134 155 155 166 166)
(194 041 043 047 049 052 062 058 068 073 077 083 093 087 097 104 114 106 116 125 135 133 134 154 154 165 165 156 156)
(195 041 043 047 049 052 062 058 068 073 077 083 093 087 097 104 114 106 116 125 135 133 134 152 152 163 165 155 157 168 168)
(196 041 043 047 049 052 062 058 068 073 077 083 093 087 097 104 114 106 116 125 135 133 134 163 163 167 167)
(197 041 043 047 049 052 062 058 068 073 077 083 093 087 097 104 114 106 116 125 135 133 134 145 145 154 154 165 165 156 156)
(198 041 043 045 049 052 062 073 093 104 114 125 125 084 085 059 059 056 126 097 098 088 088 108 108 134 139 129 129)
(199 044 047 053 053 058 058 062 112 123 123 134 136 127 127 108 138 014 015 026 026 035 035)
(200 042 048 058 058 094 095 086 106 132 137 128 138 053 123 156 156 165 165)
(201 042 048 058 058 094 095 086 106 132 137 128 138 053 123 155 155 166 166)
(202 042 048 058 058 094 095 086 106 132 137 128 138 053 123 154 154 165 166 157 157)
(203 042 048 058 058 094 095 086 106 132 137 128 138 053 123 164 164 167 167)
(204 043 047 133 137 055 125 155 155 164 164)
(205 043 047 133 137 055 125 155 155 166 166)
(206 043 047 133 137 055 125 154 154 165 165 156 156)
(207 043 047 133 137 055 125 163 163 167 167)
(208 042 046 057 057 127 127 132 136 068 118 053 123 091 092 094 095)
(209 041 044 131 132 137 139 052 122 048 128 113 113 094 104 085 085 066 076 057 057 152 152 163 165 155 157 168 168)
(210 044 046 053 053 057 057 123 123 127 127 134 136 062 112 068 118 155 155 164 164)
(211 044 046 053 053 057 057 123 123 127 127 134 136 062 112 068 118 155 155 166 166)
(212 044 046 053 053 057 057 123 123 127 127 134 136 062 112 068 118 154 154 165 165 156 156)
(213 044 046 053 053 057 057 123 123 127 127 134 136 062 112 068 118 152 152 163 165 155 157 168 168)
(214 044 046 053 053 057 057 123 123 127 127 134 136 062 112 068 118 163 163 167 167)
(215 052 052 063 063 074 074 085 085 096 096 107 107 118 118 058 058 067 067 076 076 094 094 103 103 112 112)
(216 044 046 053 053 057 057 123 123 127 127 134 136 062 112 068 118 043 043 064 074 085 095 106 116 137 137)
(217 044 046 052 053 057 058 062 122 068 128 131 133 137 139 155 155 164 164)
(218 044 046 052 053 057 058 062 122 068 128 131 133 137 139 155 155 166 166)
(219 044 046 052 053 057 058 062 122 068 128 131 133 137 139 154 154 165 165 156 156)
(220 044 046 052 053 057 058 062 122 068 128 131 133 137 139 163 163 167 167)
(221 044 046 055 085 094 094 096 096 103 113 107 117 122 122 128 128 131 133 137 139 145 155 166 166)
(222 042 044 132 132 053 133 074 077 104 107 088 098)
(223 042 042 043 123 134 136 107 127 095 096 087 087 058 078 045 047)
(224 043 046 048 048 052 072 057 097 083 086 103 106 125 125 134 134)
(225 043 046 048 048 052 072 057 097 083 086 103 106 125 125 136 136)
(226 043 046 048 048 052 072 057 097 083 086 103 106 124 124 135 135 126 126)
(227 043 046 048 048 052 072 057 097 083 086 103 106 122 122 133 134 125 126 137 137)
(228 043 046 048 048 052 072 057 097 083 086 103 106 133 133 137 137)
(229 043 046 048 048 052 072 057 097 083 086 103 106 125 125 134 134 145 145 136 136)
(230 042 044 046 048 059 059 051 071 082 084 102 104 055 095 076 079 089 099 106 108)
(231 014 015 026 026 035 035 044 046 053 053 057 058 052 092 093 093 104 106 097 098 108 108)
(232 044 046 053 053 057 058 052 092 093 093 104 106 097 098 088 088 073 078 125 125 134 134)
(233 044 046 053 053 057 058 052 092 093 093 104 106 097 098 088 088 073 078 125 125 136 136)
(234 044 046 053 053 057 058 052 092 093 093 104 106 097 098 088 088 073 078 124 124 135 135 126 126)
(235 044 046 053 053 057 058 052 092 093 093 104 106 097 098 088 088 073 078 133 133 137 137)
(236 043 047 055 105 103 104 125 125 134 134)
(237 043 047 055 105 103 104 124 124 135 135)
(238 043 047 055 105 103 104 124 124 135 135 126 126)
(239 043 047 055 105 103 104 133 133 136 136)
(240 044 046 053 053 057 057 052 082 058 088 083 083 087 107 094 096 116 116 113 114 125 125 134 134 136 137)
(241 042 044 046 048 053 103 057 097 102 102 094 094 105 106 122 122 133 134 125 126 137 137)
(242 044 046 104 106 053 053 057 057 093 093 097 097 052 092 058 098 125 125 134 134)
(243 044 046 104 106 053 053 057 057 093 093 097 097 052 092 058 098 125 125 136 136)
(244 044 046 104 106 053 053 057 057 093 093 097 097 052 092 058 098 124 124 135 135 126 126)
(245 044 046 104 106 053 053 057 057 093 093 097 097 052 092 058 098 122 122 133 135 125 127 138 138)
(246 044 046 104 106 053 053 057 057 093 093 097 097 052 092 058 098 133 133 137 137)
(247 055 055 115 115 082 088)
(248 044 046 104 106 053 053 057 057 093 093 097 097 052 092 058 098 042 042 064 064 075 075 086 086 108 108)
(249 102 102 106 106 053 103 056 056 044 045 047 107 048 048 125 125 134 134)
(250 102 102 106 106 053 103 056 056 044 045 047 107 048 048 125 125 136 136)
(251 102 102 106 106 053 103 056 056 044 045 047 107 048 048 124 124 135 135 126 126)
(252 102 102 106 106 053 103 056 056 044 045 047 107 048 048 133 133 137 137)
(253 012 013 024 024 035 045 054 064 056 066 073 083 077 087 092 092 098 098 101 103 107 109 125 125 136 136)
(254 012 015 132 132 023 133 054 054 045 046 057 058 068 088 094 094 105 106 097 098)
(255 012 013 024 024 035 045 054 064 056 066 073 083 077 087 092 092 098 098 101 103 107 109 133 133 137 137)
)
)
(eval
(list 'defun 'LM:GrText '( str / asc lst vec xco yco )
(list 'setq 'vec
(list 'quote
(mapcar
(function
(lambda ( b )
(cons (car b)
(mapcar
(function
(lambda ( a )
(list (rem a 10) (/ a 10))
)
)
(cdr b)
)
)
)
)
vec
)
)
)
'(setq xco 0 yco 0)
'(repeat (strlen str)
(setq asc (ascii str)
str (substr str 2)
)
(cond
( (= 32 asc)
(setq xco (+ xco 09))
)
( (= 09 asc)
(setq xco (+ xco 36))
)
( (= 10 asc)
(setq xco 0
yco (- yco 16)
)
)
( (setq lst
(cons
(mapcar
(function
(lambda ( a )
(list (+ (car a) xco) (+ (cadr a) yco))
)
)
(cdr (assoc asc vec))
)
lst
)
)
(setq xco (+ xco 9))
)
)
)
'(apply 'append lst)
)
)
(LM:GrText str)
)
;; Display GrText - Lee Mac
;; pnt - cursor point in UCS
;; vec - GrText vector list
;; col - Text Colour (ACI Colour)
;; xof - x-offset from cursor in pixels
;; yof - y-offset from cursor in pixels
(defun LM:DisplayGrText ( pnt vec col xof yof / scl )
(setq scl (/ (getvar 'viewsize) (cadr (getvar 'screensize)))
pnt (trans pnt 1 2)
)
(grvecs (cons col vec)
(list
(list scl 0.0 0.0 (+ (car pnt) (* xof scl)))
(list 0.0 scl 0.0 (+ (cadr pnt) (* yof scl)))
(list 0.0 0.0 scl 0.0)
'(0.0 0.0 0.0 1.0)
)
)
)