(The command "-xref" * * * * * omits the add-on-demand condition here)
(command "-xref" "a" (getfiled") Select the file to be referenced ""DWG "0)' (00)"1"1""0")
"A" stands for attachment.
(0 0) The insertion position in the diagram can be (getpoint "Specify the insertion point position:").
Program according to the prompt
I hope this helps.