Quantcast
Channel: Autodesk AutoCAD forums
Viewing all articles
Browse latest Browse all 14319

Opening drawings with Lisp

$
0
0

Hello All:

 

I have a bit of code that basically allows me to pick a symbol off the screen that includes an attribute that refers to another drawing.  The referenced drawing is then supposed to open.  Here's a chunk of the funtion:

 

(cond

  (switch_filename (progn
    (vl-load-com)
    (setq acadDocs (vla-Get-Documents (vlax-get-acad-object)))
    (setq newDoc (vla-Open acadDocs switch_filename))
    (vla-Activate newDoc)
                   )
  )
)

 

Here's my problem:  If I open a folder and double click into a file and then run the routine it works fine.  If I open a drawing in a folder other than the one I started in (all of these folders are on our network) newDoc returns nil and the function fails.  I'm kind of a newbie when it comes to the vla and vlax extensions to AutoLISP.

 

Any help would be appreciated.

 

Mark


Viewing all articles
Browse latest Browse all 14319

Trending Articles