Hi,
it seems property handler SetValue method doesn't work in MicroStation CONNECT Edition
Simple test code:
Sub ProcessShapes() Dim esc As ElementScanCriteria Set esc = New ElementScanCriteria esc.ExcludeAllTypes esc.IncludeType msdElementTypeShape Dim ee As ElementEnumerator Set ee = ActiveModelReference.Scan(esc) Do While ee.MoveNext ProcessElement ee.Current.AsShapeElement Loop End Sub Private Sub ProcessElement(el As ShapeElement) Dim ph As PropertyHandler Set ph = CreatePropertyHandler(el) Dim accstr() As String accstr = ph.GetAccessStrings If (True = ph.SelectByAccessString("Weight")) Then ph.SetValue "7" End If End Sub
In MicroStation V8i this code changes the weight of all found shapes to 7, in CONNECT Edition it does nothing. I tested also other access string with the same (bad) results.
With regards,
Jan
Thanks Jan.
Defect 290647 has been logged for this.
Regards,Leonard Jones.
Answer Verified By: Jan Šlegr
Hi Leonard Jones
Unknown said:Defect 290647 has been logged for this.
Can you please check if this defect was solved in Update 1 release? I made a quick test and it seems it still does not work, but I'd like to be sure the problem is not in my code.
TIA Jan
Bentley Accredited Developer: iTwin Platform - AssociateLabyrinth Technology | dev.notes() | cad.point
This defect is fixed and will be available in the next update (Update 2). Regards, Leonard Jones.
Hi Paul,
Unknown said:Just be aware - the VBA PropertyHandler interface has always had an ambiguity problem.
It's good comment. I did not think about too much but it's evident such problem can arise. Fortunately usually the customer is author of data structure, regardless it was tags, EC data or ItemTypes (or is able to negotiate it).
It looks like good best practices to don't use common names for ItemTypes properties.
Regards,
Tested and confirming this Defect 290647 is fixed in MicroStation CONNECT Edition Update 2 – Version 10.02.00.39
Reference
Resolved issues in MicroStation CONNECT Edition Update 2