Page 1 of 1

Add Optionally Modelled Properties Programatically

Posted: 27 Mar 2018, 15:58
by acidiclustre
Hi,

I am trying to create a simple DI Information Model and I am adding my instances of 'DeviceType' programatically. Now, the DI DeviceType has some Optional Properties. How can I make sure that when I create an Instance for this type some or all of the Optional properties are also created? As far as I could observe the CreateObjectSettings getter setters, I couldn't find any flag or something which would help me achieve what I am trying to (I am trying to create the instance as shown in the docmentation under 'HowTo and Short Tutorial' -> 'HowTo for .Net Server' -> 'HowTo: Create a Server supporting...' -> 'Step7: Create an Object Instance' ).
I understand that I have to somehow make use of the autogenerated DeviceModel Class in the DIClasses.cs file (which is generated by UAModeler), but is there a tutorial on how I could be able to do that?

Thanks,
Sup

Re: Add Optionally Modelled Properties Programatically

Posted: 15 Jun 2018, 06:32
by Support Team
Hello,

There is no tutorial. If you want to create optional children, you need to specify the OptionalBrowsePaths in the CreateObjectSettings. You can get the strings for setting this property with AbsoluteName.ToString.
Please see
[*] OptionalBrowsePaths
[*]AbsoluteName.ToString