Mikrom,
That is the ticket! Thanks for your help. It is doing exactly what I need. No I can get on with breaking up these pesky entities and eliminate all the extra work I was doing.
Brian
Finally getting back to this and tried another stab using Mikrom's code.
set fi [open data_files\\strings_dtms\\topos\\1998\\polymesh.dxf "r"]
set fo [open tempwrite.str "w"]
set a "VERTEX"
#target entity to search for
set out_line {}
while {! [eof $fi]} {
# read line from file
set...
Ah,
I think I know the disconnect. In the file I am parsing, it contains sometimes several thousand lines. Each group of lines (as few as 4 and as many at 30+) are identified by a entity type. As mentioned, I am only interested in the entity type "VERTEX" which when found contains 21...
Thanks for the suggestion mikrom,
I plugged your code in and appear to be getting an endless loop (ran 5 minutes) After killing the run, the temp file had nothing in it.
Not sure what it occuring.
Brian
Greetings,
I work with topographical cad files which normally contain well behaved polyline entities (2d, 2d with elevation and 3d linework). Most of the tools I have deal with these various entities. However, I often run across older cad files that contain polymesh entities. These rascals...
thacoda,
I suspect that your solution would have solved my issue. I ran the routine with and without quotes. Adding the quotes gave me the final error of "the system cannot find the specified path". Without the quotes I got a "does not recognize this command" or somesuch error. The last...
reading http://www.tcl.tk/man/tcl8.5/TclCmd/exec.htm#M24 there are notes about windows systems
I might not have a console attached to the application which apparently prevents exec from functioning. TCL is functioning within a 3rd party program.
Brian
Removed the [] and got
Warning: Tcl generated error at line 13:
couldn't execute "copy": no such file or directory
while executing
"exec copy data_files/geological_database/stratalines/dtms/prefix.txt+data_files/geological_database/stratalines/dtms/ovb_grid.dtm...
feherke,
I am trying your approach. I generated a permenant prefix file using the put noneline command. This file will never change. The other files will routinely be regenerated as new information is added thus requiring the path name being added back into the regenerated file.
However I...
Figured it out!
Here is my code
# code to add missing path in .dtm file
set fi [open data_files\\geological_database\\stratalines\\dtms\\l1_grid.dtm r]
set fo [open data_files\\geological_database\\stratalines\\dtms\\l1_grid_temp.dtm a]
append line...
I am trying to add a path to the .str file referenced in the header line of the text file. I use concat all the time in excel so that experience led me down that path.
Do I need APPEND instead? I am trying it now but cannot seem to get it to work (yet).
Brian
Thanks for the reply feherke,
After pondering over this, for now, I can stand parsing the old file to a new file and "Concat"ing the new text in.
Here the first two lines from the initial file
L1_grid.str,6251187200;algorithm=standard;fields=x,y
1, 672673.000, 1278320.000, 465.414,
Here is...
thacoda,
Thanks for the reply. Two points on using sed. First, the programs I am using are on a Windows 7 machine. It could be loaded it onto this machine and then follow your suggestion. I am researching this option (little prior experience with Unix/ Sed before).
The downside of this...
Howdy,
I am a new user of TCL macros with a software package used in house.
The software creates a text file. The first line of the file is supposed to contain both the path and name of a partner file. Due to a bug is the software, the path is not being added to this first line of the test...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.