Community
Hi,
I just did a command to remove the xref path using VLA-PUT-PATH. It work well, but the display of the new path is not correct. It's still have the old path. I have to close the drawing, and open it again to have the display of the new path.
Is there a VL fonction to refresh the display of new information in the Dialog Box as the one for the Xrefs?
Thanks.
Marcel
Try this
(defun C:TEST (/ *error* ss xref new_path) (defun *error* (msg) (if (not (member msg '("Function cancelled" "quit / exit abort"))) (princ (strcat "\nError: " msg))) (princ) ) (if (and (setq ss (ssget ":E:S" '((0 . "INSERT")))) (eq (vla-get-IsXref (setq xref (vla-item (vla-get-Blocks (vla-get-ActiveDocument (vlax-get-acad-object)) ) (vla-get-EffectiveName (vlax-ename->vla-object (ssname ss 0)) ) ) ) ) :vlax-true ) (setq new_path (getfiled "Select new Xref path" "C:\\" "dwg" 8)) ) (progn (vlax-put xref 'Path new_path) (vlax-put xref 'Name (vl-filename-base new_path)) (vla-reload xref) ) ) (princ) )
Some error trap still need, i.e. if you try to attach a dwg with the same name as a block existent in your drawing.