Message 1 of 8
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello everyone on the forum!
I'm facing a difficulty, which in this case I've already looked for several alternatives here on the forum, but none of them gave me any feedback. Directly my autocad loses the references (like the attached image).
I was doing a lisp to reload, because I have a standard folder,
so all my references are always in a standard folder. but nothing worked, nothing I've ever found on the forum or what I tried to create
(defun c:r-xrefs (/ doc xrefs item name path fullpath basepath)
(vl-load-com)
(setq doc (vla-get-ActiveDocument (vlax-get-acad-object)))
(setq xrefs (vla-get-blocks doc))
(setq basepath (vl-filename-directory (vl-filename-directory (getvar "DWGPREFIX"))))
(vlax-for item xrefs
(if (= :vlax-true (vlax-get-property item 'IsXRef))
(progn
(setq name (vlax-get-property item 'Name))
(setq path (vlax-get-property item 'Path))
(princ (strcat "\nXref: " name ", Caminho atual: " path))
(if (or (= (vl-string-right-trim " " (strcase path)) "XREF NOT FOUND")
(vl-string-search "..\\" path))
(progn
(setq fullpath (strcat basepath "Base\\" name ".dwg"))
(if (findfile fullpath)
(progn
(command "_-xref" "_Path" name fullpath)
(command "_-xref" "_Reload" name)
(princ (strcat "\nReassociando e recarregando Xref: " name " com novo caminho: " fullpath))
)
(princ (strcat "\nFalha ao encontrar arquivo no caminho: " fullpath))
)
)
(princ (strcat "\nXref: " name " já está carregado e não precisa de atualização."))
)
)
)
)
(princ)
)
(princ)
Does anyone know what else can be adjusted or have an idea of how it is possible?
Solved! Go to Solution.