请问中望3d2025使用该方法在装配体中隐藏指定零件名称后,模型树滚动条每次都会滚到最前,如图执行前和后的图片,有啥方法不这样吗
执行前
执行后
int HideTable3D(const set<Name_num>& Name_List)
{
evxFileSubtype fileSubType = VX_SUBTYPE_NONE;
cvxFileInqSubType(NULL, &fileSubType);//获取文件类型
if (fileSubType != VX_NORMAL_ASSEMBLY)//为组件
{
errMsg.append(“需在组件环境下!”);
return -1;
}
std::unordered_set<std::string> fastLookup;
fastLookup.reserve(Name_List.size());
for (const auto& item : Name_List)
{
fastLookup.emplace(item.name);
}
inthandleCount = 0;
szwEntityHandle* inHandle = NULL;
szwEntityHandle* outHandleList = NULL;
rs = ZwComponentListGet(inHandle, -1, false, true, true, &handleCount, &outHandleList);//遍历装配体
for (size_t i = 0; i < handleCount; i++)
{char fileName[256] = { 0 };//文件名
vxRootName rootName = {};//根对象名
rs = ZwComponentFileAndRootGet(outHandleList[i], sizeof(fileName), fileName, sizeof(rootName), rootName);
if (fastLookup.count(fileName))
{ rs = ZwComponentVisibilitySet(outHandleList[i], 0);//隐藏赋值属性的零件
}
}
if (ZwEntityHandleListFree(handleCount, &outHandleList) != 0)//释放内存
{
errMsg.append(“FreeMemoryNG”);
WriteMessage(errMsg.c_str());
}
return rs;
}



















