Modifying revit config

Modifying revit config

Anonymous
Not applicable
1,183 Views
2 Replies
Message 1 of 3

Modifying revit config

Anonymous
Not applicable

Hi,

Am creating a plugin in c# that is going to be a floating window, I want the window to communicate with a service.  Todo this I need to put some endpoints into the config but I don't want to do this by hand and I was just wondering if you guys have come across needing to include some custom settings in the config and how you got around it.

Thanks,
Chris

0 Likes
1,184 Views
2 Replies
Replies (2)
Message 2 of 3

Joe.Ye
Alumni
Alumni

 

Hi Chris,

 

I think you can use the methods and classes in .NET framework to access the standard Revit.exe.config file.

Here is links about accessing XML file.

 

http://www.c-sharpcorner.com/UploadFile/mahesh/ReadWriteXMLTutMellli2111282005041517AM/ReadWriteXMLT...

 

http://www.codeproject.com/Articles/11589/Read-Write-Configuration-in-XML-file

 

Sorry no handy code shows the process.



Joe Ye
Contractor
Developer Technical Services
Autodesk Developer Network
0 Likes
Message 3 of 3

Anonymous
Not applicable

I was having the same issue. I wanted to set the ConnectionString property in the Revit.exe.config file programmatically, to be able to us Entity Framework.

I end up using the NET Framework ConfigurationManager Class. 

 

More info:

 

http://msdn.microsoft.com/en-us/library/system.configuration.configurationmanager.aspx

http://stackoverflow.com/questions/15900612/how-to-read-write-this-app-config-setting

 

 

 

 

0 Likes