我想在基于 php 的站点上传后获取 dxf 文件的属性值 [英] I want to get properties value of dxf file after uploading on php based site

查看:19
本文介绍了我想在基于 php 的站点上传后获取 dxf 文件的属性值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在创建一个 php 网站,用户将在其中上传 dxf 文件(Autocad 2D),我们希望获取定义到文件中的所有属性值,例如尺寸、零件数量、材料体积、机器空间等.因此我们可以使用该值用于计算价格并向用户显示构建所需的成本.

I am creating a php website where user will upload a dxf file(Autocad 2D) and we want to get all properties values which defined into the file like Size, part count, Materiel volume, machine space etc. So we can use that value to calculate the price and show to the user how much cost will it take to build.

推荐答案

根据 Maxence 的回答,您需要阅读 DXF 规范.基本上一个 DXF 文件结构是这样的

According to Maxence answer you need to read the DXF Specs. Basically a DXF file structure is something like this

$VARIABLE
values
...
$VARIABLE2
values2
...

您可以通过使用简单的文本编辑器(如记事本、记事本++)打开来查看文件结构.

You can see the file structure by opening with a simple text editor (like notepad, notepad++).

DXF 文件结构开头的示例部分是

An example partial of a beginning of DXF file structure is

  0
SECTION
  2
HEADER
  9
$ACADVER
  1
AC1009
  9
$INSBASE
 10
0.0
 20
0.0
 30
0.0
  9
$EXTMIN
 10
18.11598045401162
 20
8.4674829624706263
 30
0.0
  9
$EXTMAX
 10
26.228964858016312
 20
14.903999246397481
 30
0.0
  9
$LIMMIN
 10
0.0
 20
0.0
  9
$LIMMAX
 10
12.0
 20
9.0
  9
$ORTHOMODE
 70
     0
  9

从这部分代码

    $ACADVER
      1
    AC1009
      9

您可以知道文件已保存的 AutoCAD 版本,从 DXF 规范 PDF 中您可以看到 AC1009 代码对应 R11 和 R12 AutoCAD 版本.

You can know the AutoCAD version which the file has been saved, from the DXF Specs PDF you can read that AC1009 code corresponds to R11 and R12 AutoCAD version.

AC1009 = R11 and R12;

这篇关于我想在基于 php 的站点上传后获取 dxf 文件的属性值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆