Kerry 发表于 2010-12-15 03:44:38

出口Bricscad铂金X-固体

这是一个如何导出在Bricscad V11白金中绘制的X-Solid的示例。由于每个固体都在Xdata中包含其ECS,因此重新排列在WCS中旋转的固体并获取范围是一项微不足道的任务:kewl:
图片、代码和附加的解决方案
// get XData and create AcGeMatrix3d
    static Acad::ErrorStatus getMatrix(AcGeMatrix3d &xform, const resbuf *pRb)
    {
      assert(pRb);
      AcGePoint3dArray points;
      Acad::ErrorStatus es = Acad::eBadUCS;
      // iterate though the xdata and collect our points
      for(const resbuf *pRbTemp = pRb;pRbTemp != NULL;pRbTemp=pRbTemp->rbnext)
      {
            if(pRbTemp->restype == 1011 /*Xdata*/)
                points.append(asPnt3d(&pRbTemp->resval.rpoint));
      }
      if(points.length() == 4)
      {
            // apply the points to a matrix
            xform.setCoordSystem(points,
                points-points,
                points-points,
                points-points);
            es = Acad::eOk;
      }
      return es;
    }
    // print the output
    static Acad::ErrorStatus printExtents(const AcDb3dSolid *pSolid, std::ofstream &file)
    {
      assert(pRb);
      if(!pSolid)
            return Acad::eNullPtr;
      AcDbExtents extents;
      if(pSolid->getGeomExtents(extents) == Acad::eOk)
      {
            file pSolid(ids,AcDb::kForRead);
                if(pSolid.openStatus()!=eOk)
                  continue;
                ResbufList xdata(pSolid->xData(_T("_X-Solids_")));
                if(getMatrix(xfrm,xdata) == Acad::eOk)
                {
                  std::auto_ptrpTmpSolid(AcDb3dSolid::cast(pSolid->clone()));
                  if(pTmpSolid.get())
                  {
                        if(pTmpSolid->transformBy(xfrm.invert()) ==Acad::eOk)
                            printExtents(pTmpSolid.get(),file);
                  }
                }
            }
            acedRestoreStatusBar();
      }
      catch (...)
      {
            acutPrintf(_T("Exception writing to file"));
      }
      file.flush();
      file.close();
    }







**** Hidden Message *****

Draftek 发表于 2010-12-15 03:49:33

BTY ARX 文件的命令是 xport

MickD 发表于 2010-12-15 04:59:30


好东西丹尼尔...
HLR Api是否已整理出来(用于隐藏线删除)

Kerry 发表于 2010-12-15 07:50:40

酷!

MickD 发表于 2011-4-12 18:53:05

的确,这是很酷的东西!它是否保存挤压实体的ecs数据
Kerry,似乎他们现在有了hlr引擎->
现在对我来说有点晚了,除非我得到定制订单什么的,我们现在使用的是Tekla结构,到目前为止,我还没有发现任何真正需要编码的东西,所以我的编码技能正在快速下降

MickD 发表于 2011-4-12 20:43:33


谢谢米克我有最新的下载..只是等待一个新的盒子出现,所以我可以安装它。

我知道这种情况米克。
页: [1]
查看完整版本: 出口Bricscad铂金X-固体