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.....
Help Needed. Plz.. Re:DXF
Moderator: General Moderators
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
?>-
juzatestdrive
- Forum Newbie
- Posts: 3
- Joined: Fri Jan 02, 2004 8:38 am
Insert/Select Entity From a Dxf file
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.
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.
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]
...
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]
...