Best way to read and write on a extern file

Started by Christina, March 29, 2015, 10:20:00 AM

Previous topic - Next topic

Christina

Hello OpenDCL users,

What is the best way to read and write on a extern file?
Or do I need to write to the Windows registry?

What i will like is that when i open Form1 in AutoCad my defaults values go’s automatically in all the present TextBoxes. And when i change or close the form1 all values in my TextBoxes go’s write to that file.
If you can point me to a direction or can show little example I will feel very happy!

Thank you to read my wish,
Christina

Jim Short

Hi Christina,

I think you are asking where to keep your dialog default values. Where you keep them depends on how you need them to be available. Storing values in the Autocad dictionary makes them reside in the drawing file. They will be there for anyone opening that file on their machine. If you are saving them locally on your machine then a simple old fashioned .ini file works well. This requires you develop some code to read and write those files.

Jim
Jim Short

Fred Tomke

Hi, Christina, Jim is right: it depends on your needs.
When I have built an application for my former employer, I used different ways storing information which where set in the dialog:

- the latestest size and splitter position are saved by OpenDCL itself (have a look at HKEY_CURRENT_USER\Software\Autodesk\AutoCAD\R19.1\ACAD-D002:407\Profiles\<<Profile>>\OpenDCL\Dialogs).
- I saved additional settings into the registry.
- settings for export to other machines I've stored in xml files (reading with chilkat xml or ms xml which comes with AutoCAD).
- complex data (depending on the drawing) were stored in complex dictionary data (don't use LData). Simple data (keys) were stored as EED (XDATA).
- settings for the whole team (in a company network) are stored in a SQlite database (I've built an extra .NET library with lisp functions for SQLite access for the Lisp-programmers) or in a mysql database (for a single customer).

Hope that helps a bit.
Fred
Fred Tomke
Dipl.-Ing. (FH) Landespflege

[ landscaper - landscape developer - digital landscape and urban design]

Christina

Hello Jim,
Yes, I want to keep always the dialog default values…
I will search example of .ini file on the internet.
Thank you for your fast reply!

Hello Fred,
I see what you mean and will look at your link!
Thank you for your fast reply!

Christina