Jump to content

AutoCAD Command Prompt when there is no drawings in Acad Editor.


muck

Recommended Posts

I am making a open command that controls autocads Default directory using VBA and Lisp.

My program will use open common dialog box to open a drawing with the last default dir

set by the previous saved drawing. No matter if Autocad is open by Ms Explorier or AutoCAD

open command. I use lisp to open my VBA open program at the command prompt. Maybe I

can change an AutoCAD menu macro to do the same thing?

 

Thank you,

Link to comment
Share on other sites

I am making a open command that controls autocads Default directory using VBA and Lisp.

My program will use open common dialog box to open a drawing with the last default dir

set by the previous saved drawing. No matter if Autocad is open by Ms Explorier or AutoCAD

open command. I use lisp to open my VBA open program at the command prompt. Maybe I

can change an AutoCAD menu macro to do the same thing?

 

 

On my system, the last directory used is the 'default' directory for the open dialog ... what am I missing? :?

Link to comment
Share on other sites

mine also, when ever i use the open command it opens the last directory i was in that i opend a file in. are we not understanding what you want to accomplish?

Link to comment
Share on other sites

Perhaps something like this will be useful:

 

(defun c:TEST (/ fileName)
 (vl-load-com)
 (cond (*acadApp*) ((setq *acadApp* (vlax-get-acad-object))))
 (if (setq fileName (getfiled "Select File" "[color=red]YourFilePathGoesHere[/color]" "dwg" )
   (vla-put-activedocument *acadApp* 
     (vla-open (vla-get-documents *acadApp*) fileName :vlax-false)))
 (princ))

 

 

Note - Code will not function if SDI = 1.

 

Hope this helps!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...