Hi Rudy,
Thanks for pointing that file out. There seem to be lots of threads out
there with ideas related to acad.mnl.
I'll check them out.
Thanks,
Carlos
"Rudy Tovar" wrote in message
news:4954108@discussion.autodesk.com...
Add it to acad.mnl.
"Carlos" wrote in message
news:4954048@discussion.autodesk.com...
Hello,
In the AcadDoc I check to see if the current profile is a special one that I
created. If it is, I show the user a list of filenames (just a bunch of
strings in a dialog box) and have them select the one to be opened.
The problem is that my OpenDwgFile function crashes AutoCAD unless I add
another (command pause) line before the vla call. Without it, the error
message is: "Bad argument type: VLA-OBJECT nil".
It works with the extra pause, but the original drawing "Drawing1.dwg"
remains busy for the remainder of the session. Also, if I start AutoCAD in
a different profile and then in my special one, it makes me click on the
screen before it opens the new drawing (responding to the extra pause).
Any ideas on what's going on with the pauses and AutoCAD? Here's my
OpenDwgFile function:
(defun OpenDwgFile (dwgFile / acad acadDoc openDoc)
(vl-load-com)
(setq nameAndPath (strcat dwgFile ".dwg"))
(if (setq fullPath (findfile nameAndPath))
(progn
(while (= (logand (getvar "cmdactive") 1) 1)
(command pause)
)
;(command pause)
(vla-activate (vla-open (vla-get-documents (vlax-get-acad-object))
fullPath :VLAX-TRUE))
)
(progn
(alert "Cannot find structure drawing!")
)
)
)
Thanks so much!
-Carlos