Community
AutoCAD Forum
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Restoring ACAD.CUIX via LSP?VLA?VBA

2 REPLIES 2
Reply
Message 1 of 3
SouthernCAD
361 Views, 2 Replies

Restoring ACAD.CUIX via LSP?VLA?VBA

At my company we run several 3rd Party Applications on top of ACAD.that like to mess with workspaces, instead of loading their own workspace they will sometimes grab the current (defualt) workspace and add its own menu or tool bar to it. A lot of time this default workspace is one that the user him/herself creates that is taylored to their preference. Sometime that procedure will not execute properly and the workspace will get completely hosed. Basic ACAD menus (IE File Edit) will go missing along with any custom menus a user may have added to their workspace.

 

To combat this I have in the past have manually saved a backup of the users ACAD.CUIX file only to restore when things go south and the user has lost all of their workspace settings or when they have hosed things up on their own. To try and make things even easier I am trying to write a small routine that will restore the backed up CUIX for them.

 

The program will let them save a backup when they so choose and restore it when ever they want. The backing up part works great but the restore part I am having fits with. I have found that if you over write the ACAD.CUIX while ACAD is running, it corrupts the file when you try to exit the session and you have to manually restore a copy when ACAD is closed. Make sense... so I have tried loading a profile that does not have acad.cuix loaded then restoring their ACAD.CUIX and then switching back to a profile that has the CUIX loaded.... still no go...

 

I guess I am going about this all wrong. So I want to ask First. What is the proper way to restore worskpaces? I believe they are stored in the ACAD.CUIX (Hence why I am focusing on that CUI) but is there another way of going about this?

 

I know this may sound crazy but its a legitimate need here.......

 

Thanks 🙂

2 REPLIES 2
Message 2 of 3
dgorsman
in reply to: SouthernCAD

 The profile determines the Main and Enterprise CUIx files in use.

The Main and Enterprise CUIx files in use determine the available workspaces.

Programmatic control of workspace content is a Royal PITA.  I don't recommend using the ACAD.CUIx as either a Main or Enterprise; make it partial to the Enterprise so it doesn't get touched.  Where possible set up separate workspaces for each major third-party application, especially those that like to diddle with the workspace or require a specifically-named workspace, and create a specific Enterprise and Main CUIx file for that role.

----------------------------------
If you are going to fly by the seat of your pants, expect friction burns.
"I don't know" is the beginning of knowledge, not the end.


Message 3 of 3
SouthernCAD
in reply to: dgorsman

Sorry for the very late reply. Thank you for your input.

 

I have found a solution that works for me and I thought I would post it to hopefully help others that may be needing perform the same function.

 

This is what I had to do:

 

1. I created a 'dummy profile' that had a 'dummy' CUIX as its Main CUIX. ACAD.CUIX is not loaded at all in this profile.

 

2.When copying the ACAD.CUIX the dummy profile is loaded and then I copy out the users ACAD.CUIX. This is because If I try to copy ACAD.CUIX out while its loaded, it will become corrputed. Unloading it completley prevents this.

3. When Overwriting a ACAD.cuix (restoring a saved copy) I do the same as above except I delete the local ACAD.CUIX before I restore the backup.

 

Doing it this way has worked everytime I have tried it. No corruptions.

 

 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost