如下图:物料编码 和 物料名称属性 是通过自定义UDA的方式建立的。
我代码如下,通过PropertyHandler 设置了物料编码。 但是 UDA里面没有更改到
如果手动更改UDA物料编码信息 ,那么元素属性里面物料编码可以跟着变化。
应该怎么操作才能修改到UDA信息呢?
我就是想在导出报表时附带物料信息。
BOOL CCommonOperate::SetMaterialInfoToElm(Bentley::Interop::MicroStationDGN::Element^ele,map<CString,CString> infoMap){ Bentley::Interop::MicroStationDGN::PropertyHandler^ph=Bentley::MstnPlatformNET::InteropServices::Utilities::ComApp->CreatePropertyHandler(ele); map<CString,CString>::const_iterator ite; for(ite=infoMap.begin();ite!=infoMap.end();++ite){ CString strKey = ite->first; CString strValue = ite->second; if(ph->SelectByAccessString(CCommonOperate::GetCSharpString(strKey))){ if(strKey == _T("CISDI_Material_Code") || strKey == _T("CISDI_Material_Name")){ System::String^sValue = CCommonOperate::GetCSharpString(strValue); ph->SetValue((System::Object^%)sValue); }else{ CString curString = CString(ph->GetValue()->ToString()->Trim()); if(curString.IsEmpty()){ System::String^sValue = CCommonOperate::GetCSharpString(strValue); ph->SetValue((System::Object^%)sValue); } } }else{ return FALSE; } } return TRUE; }
刚才帮您咨询了BRCM开发专家,得到的答案是:
现在还没法实现,只能通过UI操作。明年九月份的release会加上一些改变UDA的API,到时候用户可以调用这些API来改变UDA属性
Answer Verified By: 瑞 胡