app.config file useability

app.config file useability

bradeneuropeArthur
Mentor Mentor
539 Views
8 Replies
Message 1 of 9

app.config file useability

bradeneuropeArthur
Mentor
Mentor

Why is there a app.config and what is the useability if compiled/copied also to the plugin folder of Inventor? 

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !


 


EESignature

0 Likes
540 Views
8 Replies
Replies (8)
Message 2 of 9

Pineapple2024
Advocate
Advocate

To save setting, parameter of the addin.

I used it to save last location of dialog box.

Another to save Tap drill depth multiplier setting.

 

Those setting usually only last until IV close.

0 Likes
Message 3 of 9

bradeneuropeArthur
Mentor
Mentor

That doesn't work for me.

If I change the settings in my addin there is no change in the app.config in the applicationaddin folder.

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !


 


EESignature

0 Likes
Message 4 of 9

marcin_otręba
Advisor
Advisor

hi,

 

it will be stored and changed here: 

 

C:\Users\username\AppData\Local\Autodesk,_Inc\...

 

remember to use :  My.Settings.Save()

 

but why you bother to look for the file anyway? 

 

for sure it should be possible to change it to custom location but i never need it. 

I use it a lot almost in every addin i create and never had any issues.with saving and read it to my apps.

Hi, maybe you want to check my apps:


DrawingTools   View&ColoringTools   MRUFolders

0 Likes
Message 5 of 9

bradeneuropeArthur
Mentor
Mentor

I know this config file. I want to store the settings in the app.cofig in the addin folder where also the dll is stored.

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !


 


EESignature

0 Likes
Message 6 of 9

marcin_otręba
Advisor
Advisor

sorry, i have must to missed that..

 

you can give path in app.config file:

    <userSettings>
      <add key ="Path" value= "your path" ></add>

 

if you reference to system.config then you can use it in your code:

 System.Configuration.ConfigurationManager.AppSettings("Path") = ...

 for example fot inventor bin folder you can use:

System.Configuration.ConfigurationManager.AppSettings("Path") = AppDomain.CurrentDomain.BaseDirectory

Hi, maybe you want to check my apps:


DrawingTools   View&ColoringTools   MRUFolders

Message 7 of 9

Pineapple2024
Advocate
Advocate

I didn't set any path.

It'll pickup on same location as the addin.

I put config and addin in same folder.

My app.config are renamed to the addin name.

Addin file: TapDrillDepth.dll

Config file: TapDrillDepth.dll.config

 

I don't remember how I set them up 😅

0 Likes
Message 8 of 9

bradeneuropeArthur
Mentor
Mentor

@marcin_otręba 

could you please send me a example app.config file?

 

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !


 


EESignature

0 Likes
Message 9 of 9

marcin_otręba
Advisor
Advisor

So, first of all i do not know why i wrote this massacre about path in app config.. i feel ashamed. It is obvious it is not correct. thre are two possibilities wchich i know to make it possible in vb but none of it will work in inventor. I try both and they just do not work, also what it should be mentioned even if it would work it would change compleatly user settings location for all addins rather that one addin settings location.

 

one is:

 AppDomain.CurrentDomain.SetData("APP_CONFIG_FILE", Reflection.Assembly.GetExecutingAssembly().Location & ".config")

only result i got was delete of current user.config file.

 

second is to use file attribute in app config file, but it seems tonot work with usersettings tab:

 

appSettings Element (General Settings Schema) | Microsoft Learn

 

Only possible solution would be to use configurationmanager and custom config file and read and save  it using configurationmanager rather tham my.settings... 

 

in some of my addins i use possibility to export settings to config file and import it back to my apps. But it is normal txt file saved with .appsettings extension.

 

Maybe there would be some possible answer from autodesk ADN team...

 

Hi, maybe you want to check my apps:


DrawingTools   View&ColoringTools   MRUFolders