Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

vla-put-path

2 REPLIES 2
Reply
Message 1 of 3
Anonymous
918 Views, 2 Replies

vla-put-path

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

2 REPLIES 2
Message 2 of 3
phanaem
in reply to: Anonymous

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.

Message 3 of 3
Anonymous
in reply to: phanaem

I needed only the vla-reload !

 

Thanks

 

Marcel

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost