TheSwamp
Code Red => AutoLISP (Vanilla / Visual) => Topic started by: GDF on April 14, 2019, 04:06:11 PM
-
I need help in printing the contents of the enclosed text file to an alert dialog box.
Thanks
(defun AREA-O ()
(setq ff (strcat (getvar "dwgprefix") (getvar "dwgname")))
(setq ffname (substr ff 1 (- (strlen ff) 4)))
(setq fn (strcat ffname ".txt"))
(setq file3 (open fn "r"))
(alert (read-line file3))
(close fn)
(princ))
-
Something like this:
-
Thanks Jeff
-
You might want to verify that the file exists & may be opened, e.g.:
(defun area
-o2
( / des lst str txt
) )
)
)
)
)
-
Thanks Lee
Here is my complete routine hacked together. It creates rectangles with a Reactor text link.
See enclosed file. Yes, it's a crude routine!
Just remark out these functions:
(ARCH:F_S-VAR) ;;save vars
(ARCH:F_F-VAR) ;;reset vars
(ARCH:LYR "AREA") ;;create layer