I want to create a property via an automation script using the call: dms.CreateProperty(propertyName, PropertyType.Element, isFilterEnabled, isReadOnly, isVisibleInSurveyor);
I am able to use engine.GetDms();
IDms dms = engine.GetDms();
But when trying to use the dms.CreateProperty() call it can't find it is there anything I am missing here?
Thanks,
Ryan
Hi Ryan,
I tried the CreateProperty method and I am not able to get the error that you are experiencing:
// Create a DMS object IDms dms = engine.GetDms(); // Create a property dms.CreateProperty("TEST_PROPERTY", PropertyType.View, /*isFilterEnabled*/ false, /*isReadOnly*/ false,/*isVisibleInSurveyor*/ false);
Can you try generating again the class library code (DIS -> Automation Script -> Generate Class Library Code).
Please also check the answer for a similar issue (related to protocols, not scripts):
DIS 2.35.1.33 can no longer auto-generate code into QAction 63000
Hi Ryan,
I performed a small test and I was able to create a property for elements.
Once you create a property for a view, service or element, this property will be available for all the views, services or element available in the cluster.
For example, if I create a view for a property, all the views will have that property available. Furthermore, new views will contain this property as well.
It is not possible to create a property for a specific item (view, element or service). What it is possible it so set the value of a property for a specific item.
In your use case, you can set the value of a property for a specific property.
Please could you let me know if this is what you are looking for?
Hi Miguel thank you this solved the issue.
But now when the script runs I can’t see it create the property on the element that I want. How would I go about specifying the element for which I want to create the property for via the script?