This seems to work fine for binding.
To make it even faster you can auto-execute the command.
See the end of the script.
It executes the command. Autoloads. Closes the drawing.
(EDIT: Look at my next reply. You may not want a quick save, rather a save as with a different name)
It doesn't ask questions, it just binds everything.
(vla-Bind tmpObj :vlax-true) does bind->insert. Perhaps you want false (bind->bind); depending on preferences.
;; slightly modified from:
;; https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/select-and-bind-all-xrefs-in-modelspace/td-p/3651968
(defun c:XrefBind (/ tmpObj)
(vl-load-com)
(vlax-for
objs
(vla-get-ModelSpace
(vla-get-activedocument (vlax-get-acad-object))
)
(if
(and
;; block insert
(= (vla-get-ObjectName objs) "AcDbBlockReference")
;; blocks with a path are xrefs
(vlax-property-available-p objs 'Path)
;; make a temporary object
(setq
tmpObj
(vla-Item
(vla-get-Blocks
(vla-get-ActiveDocument (vlax-get-Acad-Object))
)
(vla-get-Name objs)
)
)
(not (assoc 71 (entget (tblobjname "block" (vla-get-Name objs)))))
)
;; bind xref
(progn
(vla-Bind tmpObj :vlax-true)
)
)
)
(princ)
)
;; execute command, quick save, close drawing
(defun autoload ( / )
(c:XrefBind)
(command "Qsave")
(command "close")
)
(autoload)
----
e-transmit, with autoload at the end.
It saves a .zip with the same name and in the same folder as the drawing you run it on
;; https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-etransmit-all-open-file/td-p/6063206
(DEFUN c:etra ()
(command "_qsave")
(command "_etransmit"
"_c"
(strcat (getvar "dwgprefix")
(substr (getvar "dwgname")
1
(- (strlen (getvar "dwgname")) 3)
)
"ZIP"
)
)
(command "_close" "Y")
)
;; autoload
(c:etra)