Page 1 of 1

Help Needed. Plz.. Re:DXF

Posted: Fri Jan 02, 2004 8:38 am
by juzatestdrive
Hie,

Given the informations in DXF file(in ASCII code).
Is there any way that i can insert the DXF file into a database by using mysql?

Thank you for your help.....

Posted: Fri Jan 02, 2004 9:03 am
by JAM
Sounds like the following would help to start with. Tweak it abit to fit you.

Code: Select all

<?php
    $filename = "file.dxf";
    $handle = fopen($filename, "r");
    $contents = fread($handle, filesize($filename));
    fclose($handle);
    // insert $contents into the database
?>

Insert/Select Entity From a Dxf file

Posted: Fri Jan 02, 2004 7:47 pm
by juzatestdrive
Is there a way to insert a particular entity and it's attributes in the database table from a dxf file?

CREATE TABLE line(
ID int(4),
LayerName char(20),
Color int(50),
StartX Double[(M,D)],
StartY Double[(M,D)],
StartZ Double[(M,D)],
EndX Double[(M,D)],
EndY Double[(M,D)],
EndZ Double[(M,D)],
)

/*If I'm not wrong above is how to create a table, rite? But how do I insert the details from the dxf file into the above table?*/


By the way:
Thanks for the help Jam.

Posted: Sat Jan 03, 2004 1:05 pm
by Weirdan
You'll need several manuals:
http://www.php.net/manual/en/
http://www.mysql.com/doc/en/
http://myfileformats.com/files/DXF.ZIP

[php_man]fopen[/php_man]
[php_man]fread[/php_man]
[php_man]preg_match[/php_man]
...