Alright, I think I've officially hit my wall of researchability.
I'm trying to modify the above LISP so that it writes only one layout to the new file which is named the same as the layout it exported from the source file. It currently writes two layouts (the default ones) with all the objects in the first layout copied in.
When I manually run the dbxApp code, it creates some kind of blank file from what I can tell. This contains the default Layout1 and Layout2, but I cannot use vla-put-name on these layouts, it just says "Layout does not exist for renaming". The same with trying to delete the second layout:
(vla-put-name (vla-get-layout (vla-get-PaperSpace dbxApp)) (vla-get-name lo))
(vla-delete (vla-item (vla-get-layouts dbxApp) 1))
I've tried running those before and after the CopyObjects is done. I can manually break the script and mess with the objects, they seem to work fine but they just don't allow renaming/deleting. Is this because I'm using vla-command instead of vlax-invoke?
Any help appreciated