Hi,
I need to manipulate Element Properties from code.
I need to add a property to elements that don't have it, and I need to update the value of the property if it wouldn't be correct. I'm using the IDms classes for this from a connector QAction.
I'm able to create the property using IDms.CreateProperty() and assign it to a new element by using a notify call to create it. However most of the element properties seem to be read only when using IDms.
Is IDms able to assign/update element properties?
Hi Thomas,
The following example shows how to set a property:
Hi Thomas,
You need to first cast the property to IWritableProperty as shown in this example
By default, all properties will appear as read-only but you can use the snippet from the link above to determine whether or not they are writable.
Hi Thomas,
Based on this question and other feedback, we decided to make setting properties on elements, services and views a bit more intuitive. The property objects now contain IsWritable and AsWritable methods, which replace the cast to IWritableProperty. This has been implemented in version 1.1.1.8 of the DMS library.