【BRCM CE cli】如何给自定义UDA属性赋值?

如下图:物料编码 和 物料名称属性 是通过自定义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;
}

Parents Reply Children
No Data