Author Topic: Xattach default to opened DWG folder  (Read 116 times)

0 Members and 1 Guest are viewing this topic.

Coltm16

  • Mosquito
  • Posts: 14
Xattach default to opened DWG folder
« 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)
)

ronjonp

  • Needs a day job
  • Posts: 6912
Re: Xattach default to opened DWG folder
« Reply #1 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.

Windows 10 x64 - AutoCAD /C3D 2020

Custom Build PC

Coltm16

  • Mosquito
  • Posts: 14
Re: Xattach default to opened DWG folder
« Reply #2 on: April 11, 2019, 11:05:43 AM »
That did the trick. Thanks.