Hello. I need to use pdms properties in my plugin. I want to take any unique ID from it. Can you help me with it?
Regards. Evgueny.
hi Evgueny,
PDMS properties are in the lcldrvm_props category and the properties can be accessed directly via "lcldrvm_prop_myprop" where you replace "myprop" with what ever property you are after.
Example a search for the pdms uda "discipline" with wildcard:
searchObject.SearchConditions.Add(SearchCondition.HasPropertyByName("lcldrvm_props", "lcldrvm_prop_discipline").DisplayStringWildcard("*Pip*").IgnoreStringValueCase().StartGroup());
Example a seach for the pdms uda "myprop" without wildcard:
searchObject.SearchConditions.Add(SearchCondition.HasPropertyByName("lcldrvm_props", "lcldrvm_prop_myprop").EqualValue(VariantData.FromDisplayString("testvalue")).IgnoreStringValueCase().StartGroup());
regards
Ulrik
with search object I could not work. "FindAll" method to produce an error.
But ulski gave me directions. And now i'm using:
PropertyCategories.FindPropertyByDisplayName("PDMS","USERM").Value.ToString())
this is function i use in my project. use it to load modeitem PDMS properties
input propertiesname you want search such as "Name " "Hbore" "Type"
----------------------------HOW TO USE------------------------------------------------
chaxunPDMSshuxing("Name", modelitem).Replace("DisplayString:", ""));
chaxunPDMSshuxing("Hbore", modelitem).Replace("Int32:", ""));
--------------------------------------------FUNCTION-----------------------------------------
public static string PDMSproperties(string propertiesname, ModelItem modelitem)
{
string a = "";
if (modelitem != null && modelitem.PropertyCategories.FindCategoryByDisplayName("PDMS") != null)
{
PropertyCategory pcat = modelitem.PropertyCategories.FindCategoryByDisplayName("PDMS");
if (pcat != null)
{
DataProperty PDMSpro = pcat.Properties.FindPropertyByDisplayName(shuxingming);
if (PDMSpro != null)
{
string s = PDMSpro.Name.ToString();
if (PDMSpro.Value.ToString() == "")
{
return s;
}
else
{
return PDMSpro.Value.ToString();
}
}
else
{
return a;
}
}
else
{
return a;
}
}
else
{
return a;
}
}