Hi All,
In MicroStation update 16.1 VBA there is the ability to access the members of an arrayed Item Property Type but if the property type contains other properties like an address (Street, Town, Country etc.) there does not seem to be any way to add elements to them, is that something that we will see in future releases, or is there a way to do it now.
To demonstrate this I have provided an example dgn file containing the Item Type and an element with it attached, you need to select the element then run the macro to see the result
The example file contains an Item Type "Plants" that has an IsArray property called "Plant", the intention for this is for holding information about what is planted in a certain area, it may be a mix of species and we need to store the necessary data for each species so we need an array element for each. As I see it at this time I cannot add elements to the IsArray Item Property if it contains other properties.
The attached example dgn also has an IsArray Item Type called Test that has no other properties and the mvba macro tries to add elements to both of them, but fails to create elements for the Plant Property.
Item Type Property IsArray.dgnlib ItemArrayTesting.mvba
Hi John,
it seems nobody from Bentley is willing to check this issue ;-)
I agree that VBA probably does not work right. Surprisingly AddArrayElements() method works partially, because it returns True (no error) and when you check a number of items in the array, it is increased. But that's all, attached data is not updated and when you try to update any property value, MicroStation crashes.
I recommend to create Service Request and to attach the test files (thanks for them!), plus to link this discussion.
Maybe Robert Hook or Artur Goldsweer can help to bring this issue into VBA API developers' attention?
With regards,
Jan
Bentley Accredited Developer: iTwin Platform - AssociateLabyrinth Technology | dev.notes() | cad.point
thanks for providing the test case and testing, it shows there are obviously different results with new defined property types.We will investigate further and inform you more detailed as soon as possible.
Thanks and best regards,
Artur