TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: Coltm16 on April 11, 2019, 10:57:33 AM

Title: Xattach default to opened DWG folder
Post by: Coltm16 on April 11, 2019, 10:57:33 AM
Does anyone know of a way to have the location of the xref attach dialog box always default to the folder of the active drawing? I found a way to do it with the open dialog box, and thought it would be easy to do it with the xattach box also. Thanks in advance for your help.

This is the code for open to default to the current drawing's folder:

Code: [Select]
(defun c:op (/ dwgname)
    (if (setq dwgname (getfiled "select drawing file" (getvar "dwgprefix") "dwg" 0))
        (vla-activate (vla-open (vla-get-documents (vlax-get-acad-object)) dwgname))
    )
    (princ)
)
Title: Re: Xattach default to opened DWG folder
Post by: ronjonp on April 11, 2019, 11:00:57 AM
Use this: http://www.theswamp.org/index.php?topic=5029.msg502985#msg502985
It sets a bunch of other things to the current directory too so take out what you don't want.
Title: Re: Xattach default to opened DWG folder
Post by: Coltm16 on April 11, 2019, 11:05:43 AM
That did the trick. Thanks.