Edit registry to set save location automaticly

Edit registry to set save location automaticly

Anonymous
Not applicable
1,266 Views
5 Replies
Message 1 of 6

Edit registry to set save location automaticly

Anonymous
Not applicable

Hello,

 

In my quest to remove any unnecessary clicks I want to be able to set the default location when you press Save, Save As, Demote or 'Save and replace component'.

 

Default it will show up a file save as dialogue starting from my workspace. Or my last saved location. I believe this is stored in the registry and hope to Intelligent adjust these registry value's using VBA.

 

When diving into the registry I believe I found the right keys here: HKEY_CURRENT_USER\Software\Autodesk\Inventor\RegistryVersion17.0\System\Preferences\FileDialog\

 

Problem 1:

- if i change them manually I don't find a difference in Inventor (If I change other things in the registry, this has an effect)

 

Problem 2:

how do I set them automatic using VBA? I've got the strings sFileLocation & sFileName true the rest of my code. So I would need to do something like:

 

Dim oRegFileSave as Regisry entry

set oRegFileSave as HKEY_CURRENT_USER\Software\Autodesk\Inventor\RegistryVersion17.0\System\Preferences\FileDialog\LastFileSaveDialog

oRegFileSave = sFileLocation & "/" & sFileName

 For your information, these are the registry entry's I believe I need to adjust:

edit registry.JPG

0 Likes
Accepted solutions (1)
1,267 Views
5 Replies
Replies (5)
Message 2 of 6

Anonymous
Not applicable

In the hope anybody can help,

 

Up again 🙂

0 Likes
Message 3 of 6

xiaodong_liang
Autodesk Support
Autodesk Support

Hi,

 

1) I am not clear what you meant by "no effect". Which setting you modified?

 

2) About setting registry by VBA, this is pure a question of VBA itself. Some global links may help you such as :

http://vba-corner.livejournal.com/3054.html

0 Likes
Message 4 of 6

Anonymous
Not applicable

Hello,

 

1) I want to set my save locations. (most important)

I have a macro that ask for a client name & project name & then start's a new drawing and saves it under <Workspace>\<ClientName>\<Project>\"<Project>.iam" & then open's that folder. But when creating a sub assemblys it's pop's up the save dialogue but starts at  <Workspace> instead of the folder where the main assembly is saved in.

 

The purpose of the above macro is to avoud clicking to much in the file browser whit hundreds of client's. It would be fun if the macro could also set the file save location of the sub assembly.

 

I also have a "autodrawing" macro. Based on the same principles, so the same problem there.

 

2) I want to set my default file names (nice to have)

We only use frame generator for special frames, called "Special 01", "Special 02", ... To keep the browser clean we call the layout file always; "Special 01 Layout", "Special 02 Layout",... It would be nice if it was possible this as an default in the registry. A Macro can pick up the file name of the assembly ("Special **") and just but " Layout" behind it and set as file name.

 

3) I want to set default values of dimensions (nice to have)

We work with a grid of 992mm. So if a make a pattern It would be nice to see the distance between to occurrences already filled in as 992mm. It's something small, but we type 992 a lot on one day, so it would make a difference.

 

True out Inventor I can find a lot of other small tweaks that would be nice. I'm hoping I can get to it using the registry.

0 Likes
Message 5 of 6

xiaodong_liang
Autodesk Support
Autodesk Support
Accepted solution

As I remembered, no method to change the default values of the fields in the Inventor dialogs from  registry. But with some Inventor APIs ( instead of registry), some of your requirements look feasible to me.

 

1)     set my save locations. (most important)

 

Inventor API allows you to pop out your own file dialog.  It could also set the default directoy by FileDialog. InitialDirectory. So you just need to write a plugin, start the ApplicationEvents. OnSaveDocument, in which pop out your own dialog. Please refer to API help reference [FileDialog Interface  ]. There are samples. And a blog introduces how to override save dialog.

http://adndevblog.typepad.com/manufacturing/2012/12/overriding-the-inventor-native-file-open-and-fil...

 

2)     set my default file names (nice to have) in  frame generator

another event you could use. please see this post:

http://forums.autodesk.com/t5/Autodesk-Inventor-Customization/VBA-with-frame-generator/m-p/3674732/h...

 

3)     set default values of dimensions (nice to have)

sorry, I do not see a way to set the default value of the dimension.

0 Likes
Message 6 of 6

Anonymous
Not applicable

ok, I believe this could do the trick.

 

Now getting started with my first plug-in (usualy I only work with VBA & Macro's)

 

thx for the help

0 Likes