As the title states, what is the simplest way to replace a specific line of text within a file.
I need to have the ability to replace line 5 and line 7 of a particular file progammatically, based on the current annotation scale.
|
As the title states, what is the simplest way to replace a specific line of text within a file.
I need to have the ability to replace line 5 and line 7 of a particular file progammatically, based on the current annotation scale.
More details would be helpful. What type of object needs modification?
If you have a technical question, please find the appropriate forum and ask it there.
You will get a quicker response from your fellow AUGI members than if you sent it to me via a PM or email.
jUSt
ye ask and ye shall receive.
Eagle Point uses *.set files to contain their plot scales as well as many other settings. When reducing point files, our office would like to use annotative blocks, so they will show up at acceptable sizes no matter the viewport scale. Eagle Point uses the plot scale factor to scale points when they are reduced. Our intention is to set the plot scale to 1 reduce the points (so they come in at a scale of 1) and then change the plot scale back. Or possible just set up the routine so the plot scale matches the current annotation scale (i.e. 1:1 would result in a 1 scale plot scale, 1:40 would result in a 40 scale plot scale, and so on.)
The 5th line of the *.set file contains the horizontal plot scale of the Eagle Point Project, the 7th line contains the vertical plot scale. I guess I really only need to be able to update the 5th line, as the 7th does not affect the scale of reduced points.
Here is the first 10 lines of a typical *.set file
the scales are multiplied by 12 (inches in a foot). The actual scale is 40 horizontal, 5 verticalEAGLE POINT / Systems
VERSION ad 1.0
EP Settings File
VERSION 1.0
AAPLAN000HORZSCALED 480
AAPLAN000UNITSI 21
AAPLAN000VERTSCALED 60
ACADPROTOTYPESEEDFILES Z:\Prototypes\Road Base.dwg
ALIGNMENTDATABASES Align001.MDB
CURRGRAPHICKEYS AAPLAN000
Are you wanting the user to navigate to it? Or let the computer user the CurrentDataLocation folder as it is listed in Eagle Point's registry settings to locate this file?
If you have a technical question, please find the appropriate forum and ask it there.
You will get a quicker response from your fellow AUGI members than if you sent it to me via a PM or email.
jUSt
- Make a backup copy of the file.
- You need to read the file into a list.
- Search the list for the right tag (my .set file does not have that tag as the fifth line).
- Change the number at the end to the right value
- Write the list back into the file.
A secondary routine to restore the backup file after reducing the points.
If you have a technical question, please find the appropriate forum and ask it there.
You will get a quicker response from your fellow AUGI members than if you sent it to me via a PM or email.
jUSt
so do the following?
andCode:;rename existing file ;create new file with old name and open for write ;open existing file for read ;(while read each line ;if wcmatch line matches beginning of line that needs to be changed ;replace with this line ;increment line counter) ;close both files
Code:;erase new file ;rename existing file
If you have a technical question, please find the appropriate forum and ask it there.
You will get a quicker response from your fellow AUGI members than if you sent it to me via a PM or email.
jUSt
You can do it. Be warned, I have had problems with Eagle Point when changing Eagle Point generated files. Hopefully, you won't have any of those problems.
If you have a technical question, please find the appropriate forum and ask it there.
You will get a quicker response from your fellow AUGI members than if you sent it to me via a PM or email.
jUSt