199 lines
5.4 KiB
C++
199 lines
5.4 KiB
C++
#include "stdafx.h"
|
|
|
|
static const TCHAR * sMsgPrompt[]={
|
|
#include "SetGlobal.hpp"
|
|
};
|
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////
|
|
// 设置全局变量
|
|
|
|
|
|
|
|
extern TARCH_IMPEXP BOOL g_bShowMeshShape;
|
|
//extern TARCH_IMPEXP BOOL g_bUseSimpleArmrest;
|
|
//extern TARCH_IMPEXP BOOL g_bDimAngle; //角度或弧长标注
|
|
//extern TARCH_IMPEXP BOOL g_nSpaceDispMode; //显示编号/显示名称
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
extern TARCH_IMPEXP BOOL g_bSaveProxyGraph; //默认不存储Proxy的图像
|
|
///////////////////////////////////////////////////
|
|
// 设置Proxy模式//wd
|
|
// 系统变量_T("ProxyMode"), 保存在OS注册表中
|
|
//void ProxyMode()
|
|
//{
|
|
// int bInput=g_bSaveProxyGraph;
|
|
// adsout << _T("\n代理实体方式: 0.不使用代理实体/1.使用代理实体 <") << bInput << _T(">:");
|
|
// if (ads_getint(_T(""), &bInput)!=RTCAN && bInput>=0 && bInput<=1) {
|
|
// g_bSaveProxyGraph=bInput;
|
|
// CRegProperty regProp(GetRegLocation(), _T("Settings"));
|
|
// regProp.SetTopRootKey(HKEY_CURRENT_USER);
|
|
// regProp.SetValue(_T("ProxyMode"), g_bSaveProxyGraph);
|
|
// }
|
|
//}
|
|
|
|
|
|
|
|
|
|
/* * * * * * * * * * * * * * * * * * * */
|
|
///////////////////////////////////////////////////
|
|
// 设 置 墙 体 捕 捉 方 式 的 函 数
|
|
// 系统变量_T("OsnapWall"), 保存在OS注册表中
|
|
void OsnapWall()
|
|
{
|
|
#if (ADS<=14)
|
|
BOOL bInput = g_nOsnapType;
|
|
adsout << _T("\n墙体捕捉位置: 0.墙体基线/1.墙体边线 <") << bInput << _T(">:");
|
|
if (ads_getint(_T(""), &bInput)!=RTCAN && bInput>=0 && bInput<=1) {
|
|
g_nOsnapType=bInput;
|
|
CRegProperty regProp(GetRegLocation(), _T("Settings"));
|
|
regProp.SetTopRootKey(HKEY_CURRENT_USER);
|
|
regProp.SetValue(_T("OsnapWall"), g_nOsnapType);
|
|
}
|
|
#endif
|
|
}
|
|
|
|
|
|
|
|
|
|
/* -------------------------------------------------------------------- */
|
|
|
|
#if 0
|
|
// 设置网格显示方式
|
|
// 透明命令
|
|
void MeshShape()
|
|
{
|
|
const TCHAR * pszMsg=g_bShowMeshShape? _T("<1>:") : _T("<0>:");
|
|
adsout << _T("\n是否显示魔幻网格的断面形状示意图: 1.显示/0.关闭? ") << pszMsg;
|
|
int nInput=0;
|
|
if (ads_getint(_T(""), &nInput)==RTNORM) {
|
|
g_bShowMeshShape = nInput? TRUE : FALSE;
|
|
RBList mask(RTDXF0, _T("TCH_PATHMESH"), NULL);
|
|
PickSet ss(SS_FREE);
|
|
if (ss.Get(_T("X"), NULL, NULL, mask)==RTNORM) {
|
|
UpdateGraphic(ss);
|
|
}
|
|
|
|
}
|
|
}
|
|
#endif
|
|
|
|
//////////////////////////////////////
|
|
// 开关轴网图层
|
|
// 透明命令
|
|
void TogAxisLay()
|
|
{
|
|
XDbLayerTableRec tLayer(LAY_AXIS, AcDb::kForWrite);
|
|
if (!tLayer)
|
|
return;
|
|
AcDbLayerTableRecord &lay = tLayer;
|
|
|
|
if (lay.isOff())
|
|
lay.setIsOff(Adesk::kFalse);
|
|
else
|
|
lay.setIsOff(Adesk::kTrue);
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
///////////////////////////////////
|
|
// 设置圆弧标注类型
|
|
// 系统变量_T("DimAngle"), 保存在OS注册表中
|
|
/*
|
|
void ArcDimMode()
|
|
{
|
|
int bInput=g_bDimAngle;
|
|
adsout << _T("\n圆弧标注方式: 0.弧长/1.角度 <") << bInput << _T(">:");
|
|
if (ads_getint(_T(""), &bInput)!=RTCAN && bInput>=0 && bInput<=1) {
|
|
g_bDimAngle=bInput;
|
|
CRegProperty regProp(GetRegLocation(), _T("Settings"));
|
|
regProp.SetTopRootKey(HKEY_CURRENT_USER);
|
|
regProp.SetValue(_T("DimAngle"), g_bDimAngle);
|
|
}
|
|
|
|
}
|
|
*/
|
|
|
|
///////////////////////////////////
|
|
// 设置房间显示方式
|
|
// 系统变量_T("SpDispMode"), 保存在OS注册表中
|
|
void SpDispMode()
|
|
{
|
|
int bInput=g_nSpaceDispMode;
|
|
adsout << /*UMSG*/_T("\n0.显示房间名称和面积/1.显示房间编号和面积/2.只显示房间名称/3.只显示房间编号/4.只显示房间面积. <") << bInput << _T(">:");
|
|
if (ads_getint(_T(""), &bInput)!=RTCAN && bInput>=0 && bInput<=3) {
|
|
DocSetSpaceDispMode(bInput);
|
|
RBList mask(RTDXF0, _T("ROOM"), NULL);
|
|
PickSet ss(SS_FREE);
|
|
if (ss.Get(_T("X"), NULL, NULL, mask)==RTNORM) {
|
|
UpdateGraphic(ss);
|
|
}
|
|
#if (ADS<=14)
|
|
CRegProperty regProp(GetRegLocation(), _T("Settings"));
|
|
regProp.SetTopRootKey(HKEY_CURRENT_USER);
|
|
regProp.SetValue(_T("SpDispMode"), g_nSpaceDispMode);
|
|
#endif
|
|
}
|
|
}
|
|
|
|
////////////////////////////////////////////////////////////
|
|
// Command: 透明命令
|
|
// 系统变量_T("WallDistPrec"), 保存在OS注册表中
|
|
//void DistPrec()//wd
|
|
//{
|
|
// GetDist(/*UMSG*/_T("\n墙体衔接控制精度"), g_nDistPrec, RSG_NONEG|RSG_NOZERO);
|
|
// CRegProperty regProp(GetRegLocation(), _T("Settings"));
|
|
// regProp.SetTopRootKey(HKEY_CURRENT_USER);
|
|
// regProp.SetValue(_T("WallDistPrec"), (const TCHAR *)XString(_T("%g"), g_nDistPrec));
|
|
//}
|
|
|
|
|
|
void CirDeviation()
|
|
{
|
|
GetReal(_T("\n分弧精度"),g_nCirDeviation, RSG_NONEG|RSG_NOZERO);
|
|
}
|
|
|
|
// 粗细的宽度
|
|
void LineBoldValue()
|
|
{
|
|
double nVal=DocGetHighBold();
|
|
if (GetReal(_T("\n墙柱粗线的宽度"), nVal, RSG_NONEG|RSG_NOZERO)==RTNORM) {
|
|
if (DocSetHighBold(nVal)) {
|
|
XBlockTable rec(_T("_ArchTick"));
|
|
if (rec.ent.Is(_T("LWPOLYLINE"))) {
|
|
OPENOBJ_BEGIN(rec.ent, AcDb::kForWrite, AcDbPolyline, pline);
|
|
if (pline)
|
|
pline->setConstantWidth(nVal);
|
|
OPENOBJ_END();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
void TestLineType()
|
|
{
|
|
Entity ent;
|
|
if (ads_entsel(_T("\nSelect entity: "), ent, XPoint())==RTNORM) {
|
|
AcDbObjectId idLineType;
|
|
OPENOBJ_BEGIN(ent, AcDb::kForRead, AcDbEntity, pEnt);
|
|
if (pEnt) {
|
|
idLineType=pEnt->linetypeId();
|
|
if (!idLineType) {
|
|
adsout << _T("\nNull!");
|
|
} else {
|
|
XString sName;
|
|
sName=GetSymbolName(idLineType);
|
|
adsout << sName;
|
|
}
|
|
}
|
|
OPENOBJ_END();
|
|
}
|
|
} |