天气与日历 切换到窄版

 找回密码
 立即注册
中国膜结构网
十大进口膜材评选 十大国产膜材评选 十大膜结构设计评选 十大膜结构公司评选
查看: 8|回复: 0

AuPolyline dwg文件导入导出

[复制链接]
  • TA的每日心情
    开心
    昨天 15:23
  • 签到天数: 69 天

    [LV.6]常住居民II

    410

    主题

    167

    回帖

    2704

    积分

    管理员

    积分
    2704
    发表于 2024-6-22 09:46:18 | 显示全部楼层 |阅读模式
    [code]//-----------------------------------------------------------------------------
    //----- AcDbObject protocols
    //- Dwg Filing protocol
    Acad::ErrorStatus AuPolyline::dwgOutFields (AcDbDwgFiler *pFiler) const {
            assertReadEnabled () ;
            //----- Save parent class information first.
            Acad::ErrorStatus es =AcDbPolyline::dwgOutFields (pFiler) ;
            if ( es != Acad::eOk )
                    return (es) ;
            //----- Object version number needs to be saved first
            if ( (es =pFiler->writeUInt32 (AuPolyline::kCurrentVersionNumber)) != Acad::eOk )
                    return (es) ;
            //----- Output params
            //.....
            //m_Hatch.dwgOutFields(pFiler);
            UInt32 n=m_Array.size();
            es=pFiler->writeUInt32(n);
            if ( es != Acad::eOk )
                    return (es) ;
            objArray::const_iterator it;
            for (it=m_Array.begin();it!=m_Array.end();it++)
            {
                    SOSTAV s=(*it).first;
                    Adesk::UInt32 s1=s;
                    es=pFiler->writeUInt32(s1);
                    if ( es != Acad::eOk )
                            return (es) ;
                    //const ACHAR* str = (*it).second->isA()->name();
                    //es=pFiler->writeString(str);
                    //if ( es != Acad::eOk )
                    //      return (es) ;
                    es=(*it).second->dwgOutFields(pFiler);
                    if ( es != Acad::eOk )
                            return (es) ;
            }
            es=pFiler->filerStatus ();
            return (pFiler->filerStatus ()) ;
    }

    Acad::ErrorStatus AuPolyline::dwgInFields (AcDbDwgFiler *pFiler) {
            assertWriteEnabled () ;
            //----- Read parent class information first.
            Acad::ErrorStatus es =AcDbPolyline::dwgInFields (pFiler) ;
            if ( es != Acad::eOk )
                    return (es) ;
            //----- Object version number needs to be read first
            Adesk::UInt32 version =0 ;
            es =pFiler->readUInt32 (&version);
            if  (es != Acad::eOk )
                    return (es) ;
            if ( version > AuPolyline::kCurrentVersionNumber )
                    return (Acad::eMakeMeProxy);
            //- Uncomment the 2 following lines if your current object implementation cannot
            //- support previous version of that object.
            //if ( version < AuPolyline::kCurrentVersionNumber )
            //      return (Acad::eMakeMeProxy) ;
            //----- Read params
            //.....

            Adesk::UInt32 n;
            es=pFiler->readUInt32(&n);
            if  (es != Acad::eOk )
                    return (es) ;
            for(int i=0;i<n;i++)
            {
                    //using namespace AuPolyline::AcDbEntity;
                    SOSTAV s;
                    Adesk::UInt32 s1;
                    es=pFiler->readUInt32(&s1);
                    if  (es != Acad::eOk )
                            return (es) ;
                    s=static_cast<SOSTAV>(s1);

                    ACHAR* str;
                    es=pFiler->readString(&str);
                    if  (es != Acad::eOk )
                            return (es) ;
                    std::wstring ws=str;
                    if(ws==std::wstring(_T("MyHatch")))
                    {
                            MyHatch* pH=new MyHatch;
                            es=pH->dwgInFields(pFiler);
                            if  (es != Acad::eOk )
                                    return (es) ;
                            m_Array.insert(std::make_pair(s,pH));
                    }      
                    else
                    {
                            acutPrintf(_T("неизвестный тип данных\n"));
                            return Acad::eNotOpenForRead;
                    }      
            }
            es=pFiler->filerStatus ();
            return (pFiler->filerStatus ()) ;
    }[/code]

     

     

     

     

    AuPolyline dwg文件导入导出
    中国膜结构网打造全中国最好的膜结构综合平台 ,统一协调膜结构设计,膜结构施工,膜材采购,膜材定制,膜结构预算全方位服务。 中国空间膜结构协会合作单位。
    您需要登录后才可以回帖 登录 | 立即注册

    本版积分规则

    QQ|Archiver|手机版|中国膜结构网|中国膜结构协会|进口膜材|国产膜材|ETFE|PVDF|PTFE|设计|施工|安装|车棚|看台|污水池|

    GMT+8, 2024-7-1 05:49 , Processed in 0.055600 second(s), 22 queries .

    Powered by Discuz! X3.5

    © 2001-2024 Discuz! Team.

    快速回复 返回顶部 返回列表