I did peruse that thread and gained some insight but the problem was naming the xref layer the name of the xref. From what I learned or know the xref is not a "AcDbBlockReference" until it's successfully inserted into the drawing.
The thought process I had was to only fire the reactor on vlr-commandended as I would know the attach command finished successfully.Code - Auto/Visual Lisp: [Select]
Are you saying that changing the clayer before insert, attaching the xref and changing the clayer back is more efficient than only changing the layer of the xref with vlax-put?
Maybe image attach (.tiff/.jpeg) is a simpler animal compared to .dwg xrefs.
Actually, I never thought about the issue when attaching numerous xrefs at once. IMAGEATTACH only allows inserting (1) .tiff/.jpg at a time but XATTACH will allow numerous, this indeed could be problematic. 90% of what we do is based on IMAGEATTACH the other 10% is based on XATTACH. In that case changing the layer before insert would be ideal (in terms of length of script) I imagine a semi? simple foreach function to process each xref prior to insertion. I shall dig more into that one.
In regards to multiple xrefs of the same name in different locations, from my understanding you can't have 1+ xrefs of the same name as Autocad will just use the previous definition.Code - Auto/Visual Lisp: [Select]
Command: XATTACH Xref "Drawing1" has already been defined. Using existing definition.
Standards or the lack there of is a good point, this routine was brought up as more so a "forced" standardization. Previously the layer or the xref was just "Arch-Roof" or "Civil-Utilities" or worse I have seen "XREF" here. I'll have to look more into what universities or other public standards require in terms of naming.