Seemed to be a bit of a bum-rush, eh? Does this get me back in your good graces?
(defun NewDwg (fqnName / oldCmdEcho)
(setq oldCmdEcho (getvar "CmdEcho"))
(setvar "CmdEcho" 0)
(cond ((= (getvar "SDI") 0)
(command "._VBAStmt"
(strcat "AcadApplication.Documents.Add \"" fqnName "\""))) ((command "._VBAStmt" (strcat "ThisDrawing.New \"" fqnName "\"")))) (setvar "CmdEcho" oldCmdEcho)
(princ))
Usage: (NewDwg (findfile "acad.dwt"))
--
R. Robert Bell, MCSE
www.AcadX.com
well, i'm looking, and not finding much....
i found i can do this:
(vla-sendcommand (vla-get-activedocument (vlax-get-acad-object)) "new\n") ...but that seems to pause on template selection.
the much more code-heavy:
(defun AE_NEWDWG ( template status / ae-acad-object newdwg ) (vl-load-com) (setq ae-acad-object (vlax-get-acad-object)) (if (not template) (setq newdwg (vla-add (vla-get-documents ae-acad-object))) (setq newdwg (vla-add (vla-get-documents ae-acad-object) template)) ) (if (not status) (princ "\nNew drawing created\n") (vla-put-activedocument ae-acad-object newdwg) ) (princ)
)
...alas doesn't work in SDI mode.
any other suggestions?
--Jeremiah