MOatman
in reply to: artcaddept


@artcaddept wrote:

Is anyone aware of a way to access the command line from within a cod script? Any way to send AutoCAD native or custom commands from within the cod would be helpful.


You can write a Lisp command that writes and executes a script file.  The generated script file can use information stored in variables define by the Lisp command.  Not exactly command line access.

 

(defun c:Bundle ()
(setq bundle (getstring "\nEnter Bundle Name: "))
(setq scr (strcat (getvar "Logfilepath") "tmp.cod")
ss (mapfilter "#5025 = #56 | #5025 = #109" 0 0 1)
fil (open scr "w"))
(write-line (strcat "item.customdata[\"Bundle\"].value=" (vl-princ-to-string bundle) "") fil)
(close fil)
(executescript scr ss)
(princ)
(COMMAND-S ".redraw")
)