docs: 对照表补管件族 39 条命令 #126
No files matched your search
@@ -23,6 +23,7 @@
|
||||
#include "AecDbColumn.h"
|
||||
#include "AecDbBeam.h"
|
||||
#include "AecDbClimbStair.h"
|
||||
#include "AecDbEwFitting.h"
|
||||
#include "AecDbObjXDataMap.h"
|
||||
#include "KTSetting.h"
|
||||
|
||||
@@ -1139,3 +1140,248 @@ public:
|
||||
}
|
||||
};
|
||||
EXPORT_MCP_TOOL(ToolUpdateClimbStair, UpdateAecClimbStairTool)
|
||||
|
||||
// ===========================================================================
|
||||
// 管件(AecDbEwFitting)
|
||||
// 对应菜单命令 PL_DJWT 等(弯头/三通/大小头/法兰/堵头…,都是同一个实体类,
|
||||
// 靠专业数据 KEY_RUNTIME 区分)。参数集照 TDbPipeLine::FillConfigXDataMap
|
||||
// (PipelineCmd/AecPipeLine.cpp:3204)的最小可用子集,接口尺寸里那几项要查库的
|
||||
// 先不填,绘制时会按 DN/OD/壁厚/曲率自己算。
|
||||
// ===========================================================================
|
||||
namespace
|
||||
{
|
||||
// 类型名 -> EFittingType
|
||||
bool FittingTypeFromName(const std::wstring& s, int& nType)
|
||||
{
|
||||
if (s == L"elbow") { nType = eElbow; return true; }
|
||||
if (s == L"reduce_elbow") { nType = eReduceElbow; return true; }
|
||||
if (s == L"reduce") { nType = eReduce; return true; }
|
||||
if (s == L"tee") { nType = eTee; return true; }
|
||||
if (s == L"cross") { nType = eCross; return true; }
|
||||
if (s == L"lateral") { nType = eLateral; return true; }
|
||||
if (s == L"wye") { nType = eWye; return true; }
|
||||
if (s == L"flange") { nType = eFlange; return true; }
|
||||
if (s == L"cap") { nType = eWcap; return true; }
|
||||
if (s == L"coupling") { nType = eFlxJoin; return true; }
|
||||
return false;
|
||||
}
|
||||
|
||||
bool ApplyFitting(AecDbEwFitting* p, const nlohmann::json& a, bool bCreate, std::wstring& err)
|
||||
{
|
||||
AecDbObjXDataMap* pX = p->GetSpecialtyData();
|
||||
if (pX == NULL)
|
||||
{
|
||||
err = L"取专业数据失败";
|
||||
return false;
|
||||
}
|
||||
|
||||
// 类型
|
||||
int nType = eElbow;
|
||||
if (bCreate)
|
||||
{
|
||||
const std::wstring sType = hasKey(a, "type") ? wstrOr(a, "type", L"elbow") : L"elbow";
|
||||
if (!FittingTypeFromName(sType, nType))
|
||||
{
|
||||
err = L"type 只支持 elbow/reduce_elbow/reduce/tee/cross/lateral/wye/flange/cap/coupling";
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else if (hasKey(a, "type"))
|
||||
{
|
||||
const std::wstring sType = wstrOr(a, "type", L"elbow");
|
||||
if (!FittingTypeFromName(sType, nType))
|
||||
{
|
||||
err = L"type 只支持 elbow/reduce_elbow/reduce/tee/cross/lateral/wye/flange/cap/coupling";
|
||||
return false;
|
||||
}
|
||||
pX->SetAt(KEY_RUNTIME, nType);
|
||||
}
|
||||
else
|
||||
{
|
||||
int nCur = eElbow;
|
||||
pX->GetAt(KEY_RUNTIME, nCur);
|
||||
nType = nCur;
|
||||
}
|
||||
if (bCreate)
|
||||
pX->SetAt(KEY_RUNTIME, nType);
|
||||
|
||||
// 位置与方向
|
||||
AcGePoint3d ptMid;
|
||||
if (readPoint(a, "position", ptMid))
|
||||
{
|
||||
pX->SetAt(KEY_MID, ptMid);
|
||||
// 弯头/三通还要一条中线做 2D 表达,缺省给"主管方向"
|
||||
}
|
||||
else if (bCreate)
|
||||
{
|
||||
err = L"add_aec_fitting 需要 position(管件中心点)";
|
||||
return false;
|
||||
}
|
||||
|
||||
AcGePoint3d ptDir, ptBr;
|
||||
AcGeVector3d vtMaj(1.0, 0.0, 0.0), vtMin(0.0, 1.0, 0.0);
|
||||
if (readPoint(a, "direction", ptDir))
|
||||
vtMaj = ptDir.asVector();
|
||||
if (readPoint(a, "branch_direction", ptBr))
|
||||
vtMin = ptBr.asVector();
|
||||
vtMaj.z = 0.0;
|
||||
vtMin.z = 0.0;
|
||||
if (vtMaj.length() < 1e-9) vtMaj = AcGeVector3d::kXAxis;
|
||||
if (vtMin.length() < 1e-9) vtMin = AcGeVector3d::kYAxis;
|
||||
vtMaj.normalize();
|
||||
vtMin.normalize();
|
||||
pX->SetAt(KEY_MAJBR, vtMaj);
|
||||
pX->SetAt(KEY_MINBR, vtMin);
|
||||
|
||||
// 口径(mm -> 米,与管道一致)
|
||||
double dDn = 0.0, dOd = 0.0, dTh = 0.0;
|
||||
pX->GetAt(PIPE_DN, dDn);
|
||||
pX->GetAt(PIPE_OD, dOd);
|
||||
pX->GetAt(PIPE_THICK, dTh);
|
||||
|
||||
if (hasKey(a, "dn_mm")) dDn = AS_MUNIT(numOr(a, "dn_mm", 0.0));
|
||||
if (hasKey(a, "od_mm")) dOd = AS_MUNIT(numOr(a, "od_mm", 0.0));
|
||||
if (hasKey(a, "wall_thickness_mm")) dTh = AS_MUNIT(numOr(a, "wall_thickness_mm", 0.0));
|
||||
|
||||
if (dDn <= 0.0)
|
||||
{
|
||||
err = L"管件需要 dn_mm(公称直径,mm)> 0";
|
||||
return false;
|
||||
}
|
||||
if (dOd <= 0.0)
|
||||
dOd = dDn * 1.1; // 没给外径时给个常见量级,绘制时按 DN 走
|
||||
|
||||
pX->SetAt(PIPE_DN, dDn);
|
||||
pX->SetAt(PIPE_OD, dOd);
|
||||
pX->SetAt(PIPE_TDN, dDn);
|
||||
pX->SetAt(PIPE_TOD, dOd);
|
||||
pX->SetAt(PIPE_D, dDn);
|
||||
pX->SetAt(PIPE_THICK, dTh);
|
||||
|
||||
if (hasKey(a, "ratio")) pX->SetAt(PIPE_RATIO, numOr(a, "ratio", 1.0));
|
||||
else if (bCreate) pX->SetAt(PIPE_RATIO, 1.0);
|
||||
if (hasKey(a, "connect")) pX->SetAt(PIPE_CONNECT, intOr(a, "connect", 0));
|
||||
else if (bCreate) pX->SetAt(PIPE_CONNECT, 0);
|
||||
if (hasKey(a, "color")) pX->SetAt(PIPE_COLOR, intOr(a, "color", 256));
|
||||
if (hasKey(a, "system")) pX->SetAt(PIPE_SYS, wstrOr(a, "system", L"").c_str());
|
||||
if (hasKey(a, "material")) pX->SetAt(PIPE_MATERIAL, wstrOr(a, "material", L"").c_str());
|
||||
|
||||
if (bCreate)
|
||||
{
|
||||
pX->SetAt(KEY_2DSTYLE, 1); // 双线
|
||||
pX->SetAt(KEY_SINGLE, 0);
|
||||
pX->SetAt(PIPE_RRADFLG, 1);
|
||||
pX->SetAt(KEY_RadRatio, 1);
|
||||
pX->SetAt(PIPE_DRAWDIR, (int)WPipe::eDN);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
class ToolAddFitting : public mcp_Tool
|
||||
{
|
||||
public:
|
||||
std::string private_name() const override { return "add_aec_fitting"; }
|
||||
|
||||
std::string private_description() const override
|
||||
{
|
||||
return "新建管件(AecDbEwFitting:弯头/三通/大小头/四通/法兰/堵头/箍)。"
|
||||
"给中心点、主管方向(可选支管方向)与口径;接口尺寸按 DN/外径/壁厚自算。"
|
||||
"坐标用图纸单位,dn_mm/od_mm/wall_thickness_mm 用毫米。返回新实体 handle。";
|
||||
}
|
||||
|
||||
nlohmann::json private_input_schema() const override
|
||||
{
|
||||
return nlohmann::json::parse(R"({
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"type": { "type": "string",
|
||||
"enum": ["elbow","reduce_elbow","reduce","tee","cross","lateral","wye","flange","cap","coupling"],
|
||||
"description": "管件类型:弯头/变径弯头/大小头/三通/四通/L通/Y通/法兰/堵头/箍,缺省 elbow" },
|
||||
"position": { "type": "array", "items": { "type": "number" }, "description": "管件中心点 [x,y] 或 [x,y,z]" },
|
||||
"direction": { "type": "array", "items": { "type": "number" }, "description": "主管方向 [x,y],缺省 +X" },
|
||||
"branch_direction": { "type": "array", "items": { "type": "number" }, "description": "支管方向 [x,y](弯头/三通的另一侧),缺省 +Y" },
|
||||
"dn_mm": { "type": "number", "description": "公称直径,毫米" },
|
||||
"od_mm": { "type": "number", "description": "外径,毫米(缺省按 DN 估算)" },
|
||||
"wall_thickness_mm": { "type": "number", "description": "壁厚,毫米" },
|
||||
"ratio": { "type": "number", "description": "曲率半径倍数(DN 的倍数),缺省 1.0" },
|
||||
"connect": { "type": "integer", "description": "连接方式 0 焊接 / 1 承插 / 2 螺纹 / 3 法兰,缺省 0" },
|
||||
"system": { "type": "string", "description": "管道系统名" },
|
||||
"material": { "type": "string", "description": "材质" },
|
||||
"color": { "type": "integer", "description": "ACI 颜色号,256=ByLayer" },
|
||||
"layer": { "type": "string", "description": "图层名,缺省用当前图层" },
|
||||
"space": { "type": "string", "description": "空间:Model 或布局名,缺省 Model" }
|
||||
},
|
||||
"required": [ "position", "dn_mm" ]
|
||||
})");
|
||||
}
|
||||
|
||||
nlohmann::json Execute(const nlohmann::json& args) override
|
||||
{
|
||||
if (workingDb() == NULL) return errJson(kErrNoDocument, L"没有活动图纸");
|
||||
DocLock lock;
|
||||
if (!lock.isLocked()) return errJson(kErrInternal, L"拿不到图纸写锁(有别的命令在跑?)");
|
||||
|
||||
AecDbEwFitting* pFit = new AecDbEwFitting();
|
||||
std::wstring err;
|
||||
if (!ApplyFitting(pFit, args, true, err))
|
||||
{
|
||||
delete pFit;
|
||||
return errJson(kErrBadParam, err);
|
||||
}
|
||||
return finishCreate(pFit, args, "fitting");
|
||||
}
|
||||
};
|
||||
EXPORT_MCP_TOOL(ToolAddFitting, AddAecFittingTool)
|
||||
|
||||
class ToolUpdateFitting : public mcp_Tool
|
||||
{
|
||||
public:
|
||||
std::string private_name() const override { return "update_aec_fitting"; }
|
||||
|
||||
std::string private_description() const override
|
||||
{
|
||||
return "修改已有管件:只传要改的字段(类型、中心点、方向、口径、曲率、连接方式、材质…)。";
|
||||
}
|
||||
|
||||
nlohmann::json private_input_schema() const override
|
||||
{
|
||||
return nlohmann::json::parse(R"({
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"handle": { "type": "string", "description": "管件句柄" },
|
||||
"type": { "type": "string",
|
||||
"enum": ["elbow","reduce_elbow","reduce","tee","cross","lateral","wye","flange","cap","coupling"] },
|
||||
"position": { "type": "array", "items": { "type": "number" }, "description": "新中心点(可选)" },
|
||||
"direction": { "type": "array", "items": { "type": "number" }, "description": "新主管方向(可选)" },
|
||||
"branch_direction": { "type": "array", "items": { "type": "number" }, "description": "新支管方向(可选)" },
|
||||
"dn_mm": { "type": "number" }, "od_mm": { "type": "number" },
|
||||
"wall_thickness_mm": { "type": "number" }, "ratio": { "type": "number" },
|
||||
"connect": { "type": "integer" }, "system": { "type": "string" },
|
||||
"material": { "type": "string" }, "color": { "type": "integer" }
|
||||
},
|
||||
"required": [ "handle" ]
|
||||
})");
|
||||
}
|
||||
|
||||
nlohmann::json Execute(const nlohmann::json& args) override
|
||||
{
|
||||
if (workingDb() == NULL) return errJson(kErrNoDocument, L"没有活动图纸");
|
||||
DocLock lock;
|
||||
if (!lock.isLocked()) return errJson(kErrInternal, L"拿不到图纸写锁(有别的命令在跑?)");
|
||||
|
||||
nlohmann::json err;
|
||||
AecDbEwFitting* pFit = openTyped<AecDbEwFitting>(args, L"AecDbEwFitting", err);
|
||||
if (pFit == NULL) return err;
|
||||
|
||||
std::wstring msg;
|
||||
if (!ApplyFitting(pFit, args, false, msg))
|
||||
{
|
||||
pFit->close();
|
||||
return errJson(kErrBadParam, msg);
|
||||
}
|
||||
return finishUpdate(pFit, args["handle"].get<std::string>(), "fitting");
|
||||
}
|
||||
};
|
||||
EXPORT_MCP_TOOL(ToolUpdateFitting, UpdateAecFittingTool)
|
||||
@@ -18,6 +18,7 @@
|
||||
#include "AecDbColumn.h"
|
||||
#include "AecDbBeam.h"
|
||||
#include "AecDbClimbStair.h"
|
||||
#include "AecDbEwFitting.h"
|
||||
#include "AecDbObjXDataMap.h"
|
||||
|
||||
using namespace aec_mcp;
|
||||
@@ -31,6 +32,7 @@ const char* kTypeSlab = "slab";
|
||||
const char* kTypeColumn = "column";
|
||||
const char* kTypeBeam = "beam";
|
||||
const char* kTypeClimb = "climb_stair";
|
||||
const char* kTypeFitting = "fitting";
|
||||
|
||||
// 实体 -> 五个受支持类型之一;不是这几类返回空串
|
||||
std::string supportedTypeOf(AcDbEntity* pEnt)
|
||||
@@ -44,6 +46,7 @@ std::string supportedTypeOf(AcDbEntity* pEnt)
|
||||
if (AecDbColumn::cast(pEnt)) return kTypeColumn;
|
||||
if (AecDbBeam::cast(pEnt)) return kTypeBeam;
|
||||
if (AecDbClimbStair::cast(pEnt)) return kTypeClimb;
|
||||
if (AecDbEwFitting::cast(pEnt)) return kTypeFitting;
|
||||
return std::string();
|
||||
}
|
||||
|
||||
@@ -144,6 +147,43 @@ nlohmann::json paramsOf(AcDbEntity* pEnt, const std::string& sType)
|
||||
p["width"] = rc.y;
|
||||
p["rotation_deg"] = pCol->GetRotation() * 180.0 / PI;
|
||||
}
|
||||
else if (sType == kTypeFitting)
|
||||
{
|
||||
AecDbEwFitting* pFit = AecDbEwFitting::cast(pEnt);
|
||||
if (pFit == NULL) return p;
|
||||
|
||||
const AecDbObjXDataMap* pX = pFit->GetSpecialtyData(AcDb::kForRead);
|
||||
if (pX != NULL)
|
||||
{
|
||||
static const char* kTypeNames[] = { "cabletry","pipe","fitting","elbow","reduce_elbow","reduce",
|
||||
"tee","valve","cross","equipment","flange" };
|
||||
int nType = -1;
|
||||
if (pX->GetAt(KEY_RUNTIME, nType) && nType >= 0 && nType <= 10)
|
||||
p["type"] = kTypeNames[nType];
|
||||
else
|
||||
p["type"] = nType;
|
||||
|
||||
double d = 0.0;
|
||||
if (pX->GetAt(PIPE_DN, d)) p["dn_mm"] = d * 1000.0;
|
||||
if (pX->GetAt(PIPE_OD, d)) p["od_mm"] = d * 1000.0;
|
||||
if (pX->GetAt(PIPE_THICK, d)) p["wall_thickness_mm"] = d * 1000.0;
|
||||
if (pX->GetAt(PIPE_RATIO, d)) p["ratio"] = d;
|
||||
|
||||
AcGePoint3d pt;
|
||||
if (pX->GetAt(KEY_MID, pt)) p["position"] = pointJson(pt);
|
||||
AcGeVector3d vt;
|
||||
if (pX->GetAt(KEY_MAJBR, vt)) p["direction"] = { { "x", vt.x }, { "y", vt.y }, { "z", vt.z } };
|
||||
if (pX->GetAt(KEY_MINBR, vt)) p["branch_direction"] = { { "x", vt.x }, { "y", vt.y }, { "z", vt.z } };
|
||||
|
||||
int nConnect = 0;
|
||||
if (pX->GetAt(PIPE_CONNECT, nConnect)) p["connect"] = nConnect;
|
||||
CString s;
|
||||
if (pX->GetAt(PIPE_SYS, s)) p["system"] = acharToUtf8(s);
|
||||
if (pX->GetAt(PIPE_MATERIAL, s)) p["material"] = acharToUtf8(s);
|
||||
int nClr = 0;
|
||||
if (pX->GetAt(PIPE_COLOR, nClr)) p["color"] = nClr;
|
||||
}
|
||||
}
|
||||
else if (sType == kTypeClimb)
|
||||
{
|
||||
AecDbClimbStair* pStair = AecDbClimbStair::cast(pEnt);
|
||||
@@ -226,7 +266,7 @@ public:
|
||||
return nlohmann::json::parse(R"({
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"type": { "type": "string", "enum": [ "all", "pipe", "wall", "slab", "column", "beam", "climb_stair" ],
|
||||
"type": { "type": "string", "enum": [ "all", "pipe", "wall", "slab", "column", "beam", "climb_stair", "fitting" ],
|
||||
"description": "要列出的类型,缺省 all" },
|
||||
"space": { "type": "string", "description": "空间名:Model 或布局名,缺省 Model" },
|
||||
"limit": { "type": "integer", "description": "最多返回多少条,缺省 200,上限 1000" },
|
||||
|
||||
@@ -1123,7 +1123,7 @@
|
||||
},
|
||||
{
|
||||
"name": "query_aec_entities",
|
||||
"description": "列出本插件支持的 Envi3D 自定义实体(管道/墙/板/柱/梁/爬梯),分页返回 total/returned/offset/items,每项含 handle、类型、图层、起终点、包围盒。改图之前先用它拿 handle。",
|
||||
"description": "列出本插件支持的 Envi3D 自定义实体(管道/墙/板/柱/梁/爬梯/管件),分页返回 total/returned/offset/items,每项含 handle、类型、图层、起终点、包围盒。改图之前先用它拿 handle。",
|
||||
"inputSchema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
@@ -1136,7 +1136,8 @@
|
||||
"slab",
|
||||
"column",
|
||||
"beam",
|
||||
"climb_stair"
|
||||
"climb_stair",
|
||||
"fitting"
|
||||
],
|
||||
"description": "要列出的类型,缺省 all"
|
||||
},
|
||||
@@ -1893,6 +1894,177 @@
|
||||
"dll_name": "cad_mcp_aec.dll",
|
||||
"factory_function": "UpdateAecClimbStairTool"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "add_aec_fitting",
|
||||
"description": "新建管件(AecDbEwFitting:弯头/三通/大小头/四通/法兰/堵头/箍)。给中心点、主管方向(可选支管方向)与口径;接口尺寸按 DN/外径/壁厚自算。坐标用图纸单位,dn_mm/od_mm/wall_thickness_mm 用毫米。返回新实体 handle。",
|
||||
"inputSchema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"elbow",
|
||||
"reduce_elbow",
|
||||
"reduce",
|
||||
"tee",
|
||||
"cross",
|
||||
"lateral",
|
||||
"wye",
|
||||
"flange",
|
||||
"cap",
|
||||
"coupling"
|
||||
],
|
||||
"description": "管件类型,缺省 elbow"
|
||||
},
|
||||
"position": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number"
|
||||
},
|
||||
"description": "管件中心点 [x,y] 或 [x,y,z]"
|
||||
},
|
||||
"direction": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number"
|
||||
},
|
||||
"description": "主管方向 [x,y],缺省 +X"
|
||||
},
|
||||
"branch_direction": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number"
|
||||
},
|
||||
"description": "支管方向 [x,y](弯头/三通的另一侧),缺省 +Y"
|
||||
},
|
||||
"dn_mm": {
|
||||
"type": "number",
|
||||
"description": "公称直径,毫米"
|
||||
},
|
||||
"od_mm": {
|
||||
"type": "number",
|
||||
"description": "外径,毫米(缺省按 DN 估算)"
|
||||
},
|
||||
"wall_thickness_mm": {
|
||||
"type": "number",
|
||||
"description": "壁厚,毫米"
|
||||
},
|
||||
"ratio": {
|
||||
"type": "number",
|
||||
"description": "曲率半径倍数(DN 的倍数),缺省 1.0"
|
||||
},
|
||||
"connect": {
|
||||
"type": "integer",
|
||||
"description": "0 焊接 / 1 承插 / 2 螺纹 / 3 法兰,缺省 0"
|
||||
},
|
||||
"system": {
|
||||
"type": "string"
|
||||
},
|
||||
"material": {
|
||||
"type": "string"
|
||||
},
|
||||
"color": {
|
||||
"type": "integer",
|
||||
"description": "ACI 颜色号,256=ByLayer"
|
||||
},
|
||||
"layer": {
|
||||
"type": "string"
|
||||
},
|
||||
"space": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"position",
|
||||
"dn_mm"
|
||||
]
|
||||
},
|
||||
"backend": {
|
||||
"type": "c++_dll",
|
||||
"dll_name": "cad_mcp_aec.dll",
|
||||
"factory_function": "AddAecFittingTool"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "update_aec_fitting",
|
||||
"description": "修改已有管件:只传要改的字段(类型、中心点、方向、口径、曲率、连接方式、材质…)。",
|
||||
"inputSchema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"handle": {
|
||||
"type": "string"
|
||||
},
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"elbow",
|
||||
"reduce_elbow",
|
||||
"reduce",
|
||||
"tee",
|
||||
"cross",
|
||||
"lateral",
|
||||
"wye",
|
||||
"flange",
|
||||
"cap",
|
||||
"coupling"
|
||||
]
|
||||
},
|
||||
"position": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number"
|
||||
},
|
||||
"description": "新中心点(可选)"
|
||||
},
|
||||
"direction": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number"
|
||||
},
|
||||
"description": "新主管方向(可选)"
|
||||
},
|
||||
"branch_direction": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number"
|
||||
},
|
||||
"description": "新支管方向(可选)"
|
||||
},
|
||||
"dn_mm": {
|
||||
"type": "number"
|
||||
},
|
||||
"od_mm": {
|
||||
"type": "number"
|
||||
},
|
||||
"wall_thickness_mm": {
|
||||
"type": "number"
|
||||
},
|
||||
"ratio": {
|
||||
"type": "number"
|
||||
},
|
||||
"connect": {
|
||||
"type": "integer"
|
||||
},
|
||||
"system": {
|
||||
"type": "string"
|
||||
},
|
||||
"material": {
|
||||
"type": "string"
|
||||
},
|
||||
"color": {
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"handle"
|
||||
]
|
||||
},
|
||||
"backend": {
|
||||
"type": "c++_dll",
|
||||
"dll_name": "cad_mcp_aec.dll",
|
||||
"factory_function": "UpdateAecFittingTool"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -281,6 +281,91 @@ MCP 工具是通过 `PostMessage` 在主线程的消息里跑的,**不在命
|
||||
| 参数化设备 `AecDbXEquipment` | 水池/泵房系 | `new AecDbXEquipment(dbType)` + `SetSrcString(json)` + `SetPosAndDir(pt,dir)` + `SetElev(z)`,定义走 JSON(`Pool3dCmd/ParamEquJson.cpp:291`) | 未做(要先定 JSON 的最小字段) |
|
||||
| 开洞(墙/板) | `PL_CBKD`/`PL_CDKD`/`PL_YXKD`/`PL_ZLKD`/`PL_YXCG` | 洞不是普通实体:命令建的是 `AecDbX3dPartEntity` + `AcDbX3dSolid`,再对**母体**做布尔(和"墙体倒角/倒圆"同一族)。工具要能指定母体 handle + 洞口轮廓/尺寸 | 未做(需要母体+布尔时序,风险最高) |
|
||||
| 集水井/方圆井 | `PL_JFZJ`/`PL_JYZJ`/`PL_JFYJ`/`PL_JYXJ`/`PL_JJSK` | 同上,也是 `AecDbX3dPartEntity` 组合体;井的尺寸来自对话框 | 未做 |
|
||||
|HA_TJ3T|添加三通|AecDbEwFitting|add_aec_fitting|update_aec_fitting|
|
||||
|HA_TJ4T|添加四通|AecDbEwFitting|add_aec_fitting|update_aec_fitting|
|
||||
|HA_TJWT|添加弯头|AecDbEwFitting|add_aec_fitting|update_aec_fitting|
|
||||
|HA_WTLJ|弯头连接|AecDbEwFitting|add_aec_fitting|update_aec_fitting|
|
||||
|HA_TJBJ|添加变径|AecDbEwFitting|add_aec_fitting|update_aec_fitting|
|
||||
|EL_TJ3T|添加三通|AecDbEwFitting|add_aec_fitting|update_aec_fitting|
|
||||
|EL_SJ3T|三角三通|AecDbEwFitting|add_aec_fitting|update_aec_fitting|
|
||||
|EL_TJ4T|添加四通|AecDbEwFitting|add_aec_fitting|update_aec_fitting|
|
||||
|EL_TJWT|添加弯头|AecDbEwFitting|add_aec_fitting|update_aec_fitting|
|
||||
|EL_WTLJ|弯头连接|AecDbEwFitting|add_aec_fitting|update_aec_fitting|
|
||||
|EL_STGT|三通贯通|AecDbEwFitting|add_aec_fitting|update_aec_fitting|
|
||||
|EL_4TGT|四通贯通|AecDbEwFitting|add_aec_fitting|update_aec_fitting|
|
||||
|EL_WTGT|弯头贯通|AecDbEwFitting|add_aec_fitting|update_aec_fitting|
|
||||
|EL_DJWT|单加弯头|AecDbEwFitting|add_aec_fitting|update_aec_fitting|
|
||||
|PI_CRDT|插入堵头|AecDbEwFitting|add_aec_fitting|update_aec_fitting|
|
||||
|PI_STFM|三通 阀|AecDbEwFitting|add_aec_fitting|update_aec_fitting|
|
||||
|PI_XTFM|四通 阀|AecDbEwFitting|add_aec_fitting|update_aec_fitting|
|
||||
|PL_DJWT|端加弯头|AecDbEwFitting|add_aec_fitting|update_aec_fitting|
|
||||
|PL_WTLG1|弯头连管|AecDbEwFitting|add_aec_fitting|update_aec_fitting|
|
||||
|PL_RJWT|锐角弯头|AecDbEwFitting|add_aec_fitting|update_aec_fitting|
|
||||
|PL_BJWT|变径弯头|AecDbEwFitting|add_aec_fitting|update_aec_fitting|
|
||||
|PL_GXBJ|管线变径|AecDbEwFitting|add_aec_fitting|update_aec_fitting|
|
||||
|PL_TJST1|三通连接|AecDbEwFitting|add_aec_fitting|update_aec_fitting|
|
||||
|PL_DJST|添加三通|AecDbEwFitting|add_aec_fitting|update_aec_fitting|
|
||||
|PL_PXST|偏向三通|AecDbEwFitting|add_aec_fitting|update_aec_fitting|
|
||||
|PL_DZST|定制三通|AecDbEwFitting|add_aec_fitting|update_aec_fitting|
|
||||
|PL_EFST|二分三通|AecDbEwFitting|add_aec_fitting|update_aec_fitting|
|
||||
|PL_TJST2|添加四通|AecDbEwFitting|add_aec_fitting|update_aec_fitting|
|
||||
|PL_TJDT|添加堵头|AecDbEwFitting|add_aec_fitting|update_aec_fitting|
|
||||
|PL_CRFL|插单法兰|AecDbEwFitting|add_aec_fitting|update_aec_fitting|
|
||||
|PL_CDFL|插双法兰|AecDbEwFitting|add_aec_fitting|update_aec_fitting|
|
||||
|PL_TJKG|添加卡箍|AecDbEwFitting|add_aec_fitting|update_aec_fitting|
|
||||
|SP_WTLJ|弯头连接|AecDbEwFitting|add_aec_fitting|update_aec_fitting|
|
||||
|SP_STLJ|三通连接|AecDbEwFitting|add_aec_fitting|update_aec_fitting|
|
||||
|SP_TJST|四通连接|AecDbEwFitting|add_aec_fitting|update_aec_fitting|
|
||||
|sstf|三四通阀|AecDbEwFitting|add_aec_fitting|update_aec_fitting|
|
||||
|IS_CSFL|插双法兰|AecDbEwFitting|add_aec_fitting|update_aec_fitting|
|
||||
|IS_CDFL|插单法兰|AecDbEwFitting|add_aec_fitting|update_aec_fitting|
|
||||
|IS_CRBJ|插入变径|AecDbEwFitting|add_aec_fitting|update_aec_fitting|
|
||||
|
||||
> 管件族(上表最后 39 行):这些都是同一个实体类 `AecDbEwFitting`,只靠专业数据
|
||||
> `KEY_RUNTIME` 区分(弯头/变径弯头/三通/四通/大小头/法兰/堵头/箍),
|
||||
> 所以只需要 `add_aec_fitting` / `update_aec_fitting` 两个工具,
|
||||
> 用 `type` 参数选具体件。已实测:`type=elbow` 建出的弯头包围盒是真实尺寸
|
||||
> (DN100 → 0.10 m 量级),改 type/dn 后重新读回一致。
|
||||
|
||||
|HA_TJ3T|添加三通|AecDbEwFitting|add_aec_fitting|update_aec_fitting|
|
||||
|HA_TJ4T|添加四通|AecDbEwFitting|add_aec_fitting|update_aec_fitting|
|
||||
|HA_TJWT|添加弯头|AecDbEwFitting|add_aec_fitting|update_aec_fitting|
|
||||
|HA_WTLJ|弯头连接|AecDbEwFitting|add_aec_fitting|update_aec_fitting|
|
||||
|HA_TJBJ|添加变径|AecDbEwFitting|add_aec_fitting|update_aec_fitting|
|
||||
|EL_TJ3T|添加三通|AecDbEwFitting|add_aec_fitting|update_aec_fitting|
|
||||
|EL_SJ3T|三角三通|AecDbEwFitting|add_aec_fitting|update_aec_fitting|
|
||||
|EL_TJ4T|添加四通|AecDbEwFitting|add_aec_fitting|update_aec_fitting|
|
||||
|EL_TJWT|添加弯头|AecDbEwFitting|add_aec_fitting|update_aec_fitting|
|
||||
|EL_WTLJ|弯头连接|AecDbEwFitting|add_aec_fitting|update_aec_fitting|
|
||||
|EL_STGT|三通贯通|AecDbEwFitting|add_aec_fitting|update_aec_fitting|
|
||||
|EL_4TGT|四通贯通|AecDbEwFitting|add_aec_fitting|update_aec_fitting|
|
||||
|EL_WTGT|弯头贯通|AecDbEwFitting|add_aec_fitting|update_aec_fitting|
|
||||
|EL_DJWT|单加弯头|AecDbEwFitting|add_aec_fitting|update_aec_fitting|
|
||||
|PI_CRDT|插入堵头|AecDbEwFitting|add_aec_fitting|update_aec_fitting|
|
||||
|PI_STFM|三通 阀|AecDbEwFitting|add_aec_fitting|update_aec_fitting|
|
||||
|PI_XTFM|四通 阀|AecDbEwFitting|add_aec_fitting|update_aec_fitting|
|
||||
|PL_DJWT|端加弯头|AecDbEwFitting|add_aec_fitting|update_aec_fitting|
|
||||
|PL_WTLG1|弯头连管|AecDbEwFitting|add_aec_fitting|update_aec_fitting|
|
||||
|PL_RJWT|锐角弯头|AecDbEwFitting|add_aec_fitting|update_aec_fitting|
|
||||
|PL_BJWT|变径弯头|AecDbEwFitting|add_aec_fitting|update_aec_fitting|
|
||||
|PL_GXBJ|管线变径|AecDbEwFitting|add_aec_fitting|update_aec_fitting|
|
||||
|PL_TJST1|三通连接|AecDbEwFitting|add_aec_fitting|update_aec_fitting|
|
||||
|PL_DJST|添加三通|AecDbEwFitting|add_aec_fitting|update_aec_fitting|
|
||||
|PL_PXST|偏向三通|AecDbEwFitting|add_aec_fitting|update_aec_fitting|
|
||||
|PL_DZST|定制三通|AecDbEwFitting|add_aec_fitting|update_aec_fitting|
|
||||
|PL_EFST|二分三通|AecDbEwFitting|add_aec_fitting|update_aec_fitting|
|
||||
|PL_TJST2|添加四通|AecDbEwFitting|add_aec_fitting|update_aec_fitting|
|
||||
|PL_TJDT|添加堵头|AecDbEwFitting|add_aec_fitting|update_aec_fitting|
|
||||
|PL_CRFL|插单法兰|AecDbEwFitting|add_aec_fitting|update_aec_fitting|
|
||||
|PL_CDFL|插双法兰|AecDbEwFitting|add_aec_fitting|update_aec_fitting|
|
||||
|PL_TJKG|添加卡箍|AecDbEwFitting|add_aec_fitting|update_aec_fitting|
|
||||
|SP_WTLJ|弯头连接|AecDbEwFitting|add_aec_fitting|update_aec_fitting|
|
||||
|SP_STLJ|三通连接|AecDbEwFitting|add_aec_fitting|update_aec_fitting|
|
||||
|SP_TJST|四通连接|AecDbEwFitting|add_aec_fitting|update_aec_fitting|
|
||||
|sstf|三四通阀|AecDbEwFitting|add_aec_fitting|update_aec_fitting|
|
||||
|IS_CSFL|插双法兰|AecDbEwFitting|add_aec_fitting|update_aec_fitting|
|
||||
|IS_CDFL|插单法兰|AecDbEwFitting|add_aec_fitting|update_aec_fitting|
|
||||
|IS_CRBJ|插入变径|AecDbEwFitting|add_aec_fitting|update_aec_fitting|
|
||||
|
||||
建议顺序(按"参数清晰 + 下游价值"):**管件 → 参数化设备 → 设备(取库) → 开洞 → 井**。
|
||||
管件之所以排第一:图纸里数量最多,而且它自己就带着 3D 缓存(`Add3DBuffer` 96 处),
|
||||
|
||||
Reference in new issue
Block a user