TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: cmwade77 on April 21, 2021, 07:58:20 PM

Title: Relative Path Tool
Post by: cmwade77 on April 21, 2021, 07:58:20 PM
We have a lot of legacy drawings that have full saved paths and we ultimately need to change them to relative paths.

I have tried various LISP routines out there that claim to change the paths and while some work to a certain extent, none quite do everything, as we also need to repath images, DGNs, PDFs, etc.

So, I am writing an all new version that should also change the paths in all attached files.

This is very much a work in progress and nowhere near complete, but for some reason I am getting an error when trying to save the drawings.

I have attached the code so far, if someone can please let me know what I am doing wrong on the saving, I would greatly appreciate it.

There is also quite a bit of cleanup and completion to still be done.


EDIT:
I have a new version now, which is updated; however, there is an error when saving nested blocks, it returns:
"Automation Error. Description was not provided."

I know I must be missing something simple and stupid, but I can't figure it out.

Title: Re: Relative Path Tool
Post by: ribarm on April 22, 2021, 06:35:43 AM
Just guessing...

Code: [Select]
(vla-saveas dbxApp i)
Title: Re: Relative Path Tool
Post by: cmwade77 on April 22, 2021, 11:44:22 AM
Thank you, I knew I was missing something obvious.
Title: Re: Relative Path Tool
Post by: roy_043 on April 24, 2021, 03:20:11 AM
A dictionary is not a collection, therefore vlax-for cannot be used.
Title: Re: Relative Path Tool
Post by: cmwade77 on April 26, 2021, 06:38:22 PM
I updated the first post, I know I must be missing something simple, but on nested xrefs, I get the following error with saveas:
"Automation Error. Description was not provided."