Files
envi-code/SourceCode/Code2026/tg_shs/shs_TwtAnotate/FloorRect.cpp
T
2026-09-28 15:28:50 +08:00

39 lines
776 B
C++

#include "StdAfx.h"
#include "EditFloorRectDlg.h"
int EditFloorRect(AcDbObjectId id)
{
TDbFloorRect *pFloor = NULL;
acdbOpenObject(pFloor, id, AcDb::kForRead);
if (pFloor == NULL)
{
return 0;
}
CString sFloorName;
sFloorName = pFloor->GetFloorName();
double dFloorHeight = 0.0;
dFloorHeight = pFloor->GetFloorHeight();
pFloor->close();
CTemporaryResourceOverride vTemp;
CEditFloorRectDlg dlg;
dlg.SetFloorName(sFloorName);
dlg.SetFloorHeight(dFloorHeight);
if (dlg.DoModal() != IDOK)
{
return 0;
}
sFloorName = dlg.GetFloorName();
dFloorHeight = dlg.GetFloorHeight();
acdbOpenObject(pFloor, id, AcDb::kForWrite);
if (pFloor != NULL)
{
pFloor->SetFloorName(sFloorName);
pFloor->SetFloorHeight(dFloorHeight);
pFloor->close();
}
return 0;
}