;Add REFEDIT/REFCLOSE block editor to AutoCAD Web
;(C)2023 Arkance Systems - www.arkance-systems.cz - www.cadforum.cz
;autoload and then type:
; REFEDIT, REFSAVE, REFSET or REFCLOSE to invoke/exit the editor

(defun C:BEDIT ()
 (princ "\nBEDIT is unsupported, use REFEDIT")
 (princ)
)

(command "_UNDEFINE" "REFEDIT")
(defun C:REFEDIT ()
 (if (> (getvar "REFEDITNAME") "")
	(princ "\nYou are in the RefEdit mode already!")
	(command "_-REFEDIT" pause "_Ok" "_All" "_Yes")
 )
 (if (> (getvar "REFEDITNAME") "")(princ "\nEdit your block and exit with REFCLOSE"))
 (princ)
)

(command "_UNDEFINE" "REFCLOSE")
(defun C:REFCLOSE ()
 (if (> (getvar "REFEDITNAME") "")
	(command "_.REFCLOSE")
	(princ "\nYou are not in the RefEdit mode!")
 )
 (princ)
)

;(command "_UNDEFINE" "REFSAVE")
(defun C:REFSAVE ()
 (if (> (getvar "REFEDITNAME") "")
	(command "_.REFCLOSE" "_Save")
	(princ "\nYou are not in the RefEdit mode!")
 )
 (princ)
)

(command "_UNDEFINE" "REFSET")
(defun C:REFSET ()
 (if (> (getvar "REFEDITNAME") "")
	(command "_.REFSET")
	(princ "\nYou are not in the RefEdit mode!")
 )
 (princ)
)

(defun C:REFEDITW ()
 (princ "\nCommands REFEDIT/REFCLOSE/REFSAVE/REFSET added (see cadforum.cz).")
 (princ)
)

(princ "\nCommands REFEDIT/REFCLOSE/REFSAVE/REFSET added (see cadforum.cz).")
(princ)
