65 lines
1.3 KiB
C++
65 lines
1.3 KiB
C++
#include "StdAfx.h"
|
|
#include "crackEntitytools.h"
|
|
#include "KTExtractDwgFiler.h"
|
|
#include "KTCADUtilityEx.h"
|
|
#include "crackEntities.h"
|
|
|
|
namespace
|
|
{
|
|
void collectEntity(LPCTSTR dxf, AcDbObjectIdArray &ar)
|
|
{
|
|
if (!dxf) return;
|
|
|
|
ads_name ssSet, name;
|
|
if (acedSSGet(_T("A"), NULL, NULL, NULL, ssSet) != RTNORM) return;
|
|
|
|
Adesk::Int32 len(0);
|
|
acedSSLength(ssSet, &len);
|
|
|
|
AcDbObjectId id(AcDbObjectId::kNull);
|
|
for (long i = 0; i < len; ++i)
|
|
{
|
|
if (acedSSName(ssSet, i, name) != RTNORM) continue;
|
|
if (acdbGetObjectId(id, name) == Acad::eOk)
|
|
{
|
|
OPENOBJ_BEGIN(id, AcDb::kForRead, AcDbProxyEntity, pEnt)
|
|
{
|
|
if (!pEnt) continue;
|
|
if (CString(HY_PIPELINE_PIPE).CompareNoCase(pEnt->originalDxfName()) == 0)
|
|
ar.append(id);
|
|
}
|
|
OPENOBJ_END()
|
|
}
|
|
}
|
|
|
|
acedSSFree(ssSet);
|
|
}
|
|
}
|
|
|
|
namespace CrackTools
|
|
{
|
|
void converHyPipe2ShPipe()
|
|
{
|
|
// ľĂľ˝ËůÓĐşčŇľšÜĎß
|
|
AcDbObjectIdArray arHy(0);
|
|
collectEntity(HY_PIPELINE_PIPE, arHy);
|
|
if (arHy.isEmpty()) return;
|
|
|
|
CCivilDbPipelinePipe::rxInit();
|
|
acrxBuildClassHierarchy();
|
|
AcGePoint3d pt(AcGePoint3d::kOrigin);
|
|
|
|
for (int i = 0; i < arHy.length(); ++i)
|
|
{
|
|
OPENOBJ_BEGIN(arHy[i], AcDb::kForRead, CCivilDbPipelinePipe, pEnt)
|
|
{
|
|
if (!pEnt) return;
|
|
pEnt->m_map.GetAt(_T("36"), pt);
|
|
}
|
|
OPENOBJ_END()
|
|
}
|
|
|
|
deleteAcRxClass(CCivilDbPipelinePipe::desc());
|
|
}
|
|
}
|