This change will simplify your code somewhat.
I can't tell from your new code what you are trying to accomplish.
Thanks CAB, that does make things quite a bit easier for me to follow.
The ascii & slash references were confusing me with their intent.
This was a routine inherited from a predecessor Mike Schmidt in 1999.
Quite advanced with lisp from the work I have found in his legacy.
I've ordered a few books on AutoLISP today to make up for my weaker knowledge.
The new code I made is a bit of a mess from me testing options earlier in the day.
I copied the wrong one from a development directory on this machine I had opened in notepad without proof reading.
:ugly:
The intent was similar to the file you've cleaned up for me.
The problem with it is it returns;
Working...
*Invalid*
#@$@*!@% &!@*%?
I can't reference files from seperate folders.
All 3 files reside in a folder aptly named XREF.
The file I'm writing to resides in the one named after the discipline "MECH, ELEC, ARCH, PLUM, etc.."
They all share the same parent directory.
The first file is an xref overlay with a relative path (..\XREF\filename.dwg) insertion point 0,0 | 0 rotation | scaled 1:1
I've only been able to get the overlay with the relative path to work through the xattach dialog.
I really dont want all of these settings manual if I could do it from the getfiled browse and keep them in lisp.
I haven't found the right order to do these steps without getting the same error as the legacy file.
The second xref overlay is the titleblock again with a relative path (..\XREF\filename.dwg) insertion point 0,0 | 0 rotation | scaled = dimscale
I could not get the relative path working from the command line when I used (initdia) overlay.
The third I'm trying to keep my title block text as block inserts scaled = dimscale with a pause to allow for the files attributes dialog to fill in each text space.
I'll try to digest the changes you gave me.