Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

FileDialog.InitialDirectory not working

2 REPLIES 2
Reply
Message 1 of 3
erik.martinsson
548 Views, 2 Replies

FileDialog.InitialDirectory not working

I'm trying to set the "InitialDirectory"-property on the Inventor filedialog in Inventor 2014, using C#. Can't seem to get it working...

In the API-programming help I noticed there's a difference between stringformats in C# and VB - where C# should be in the form C:/Directory, and VB needs backslash instead (C:\Directory). 

 

Neither one is working for me - anyone having the same problem? Is this a known issue? I know it has been flagged in earlier versions of Inventor

 

Here's my code:

 

fileDialog.DialogTitle = "Save Copy As " + fileExtension;
            fileDialog.InitialDirectory = System.IO.Path.GetDirectoryName(document.FullFileName).Replace('\\', '/');
            fileDialog.CancelError = false;
            fileDialog.OptionsEnabled = true;

 

2 REPLIES 2
Message 2 of 3
yosso22
in reply to: erik.martinsson

Did you see the post from the Mfg Dev Blog?

http://adndevblog.typepad.com/manufacturing/2012/12/overriding-the-inventor-native-file-open-and-fil...
Give Kudos to further enhance the value of these forums. Thank you! Smiley Happy
Message 3 of 3
erik.martinsson
in reply to: yosso22

No i didn't, thanks! But there's an initial problem with using Windows native savedialog - I can't enable any inventor fileoptions can I? I'll have to check this out. Thanks

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

Post to forums  

Autodesk Design & Make Report