v.in.dxf

Tom Hawkins hawkins at water.ca.gov
Tue Oct 10 16:58:31 EDT 1995


Joe Leone recently sent this message:

>
>Hi
>I am trying to import a dxf file into grass.  The file comes from
intergraph which had topology built and all the areas labeled. When I
imported the file it came in nice and clean as lines, but no attributes. 
>The manual for v.in.dxf states " The v.in.dxf program will only recognise
points, lines, polylines, and text in the DXF format......." 
>Does this mean the v.in.dxf process not understand areas with attributes?
>Does the DXF format understand labeled areas?
>
>Help comments would be of help.
>Thanks 
>Joe Leone
>
>Joe.Leone at per.dwe.csiro.au
>
>

We have many Intergraph .dgn files that we bring into GRASS.  The DXF files
are easy, it is the attributes that are a pain.  A person on my staff, Steve
Turner has developed a program to strip out the Intergraph attributes into a
separate ASCII file, with each attribute a line, and each line containing
the x and y location of the attribute and the attribute itself (we call it
*.att).   

Then, we had Kenn Gardels develop a script (called load_dxf) we can use in
GRASS to import this files (each has the same name except end in *.dxf and
*.att) and create dig files.  Basically, it does v.in.dxf (our layer we want
to import is always named LUB), creates an ASCII dig file, edits the ASCII
dig file (changes the "l" to "a" for area), converts the ASCII dig back to a
binary dig, then brings in the attribute file (*.att).  A "dbase" file is
created first (this file is developed to make use of Sue Huse' database
routines she developed for GRASS).  Then, a cats file is developed, and then
v.support is run.  

Our attributes are a little complex, each attribute is has 18 fields.  But
I, being a non-programming, can edit the load_dxf file to read in other
*.att files with one or two attributes.  All the GRASS files we develop are
either developed in AUTOCAD, or imported into AUTOCAD, then output from
AUTOCAD as dxf and att files (Steve also developed the AUTOCAD LISP routines
to do this).  Thus far, this system has has worked very well.        

If your interested, I can put the load_dxf file on an anonymous ftp site for
access.  

Tom Hawkins


-----------------------------------------------------------------------------

Thomas E. Hawkins
California Department of Water Resources - Sacramento
hawkins at water.ca.gov   (916) 653-5573   Fax (916) 653-2698





More information about the grass-user mailing list