VBA Get Access String Command

Hi,

I am new to VBA in MicroStation. From reading the forum, ph.GetAccessStrings looks very useful however I am unable to get it work as expected.

In my example, I have a single line/element in a .dgn with Element ID 11704.

I am trying to use the code below with a Watch on accessStrings. When I run the code the Watch Value stays as <Out of context>, it does not display the Access Strngs like I would expect.

Can someone please advise what I am doing wrong?

Sub GET_ACCESS_STRINGS()

Dim elmId As DLong
elmId = DLongFromLong(11704)

Dim ele As Element
Set ele = ActiveModelReference.GetElementByID(elmId)

Dim ph As PropertyHandler
Set ph = CreatePropertyHandler(ele)

Dim accessStrings() As String
accessStrings = ph.GetAccessStrings

End Sub

Software:

OpenRoads Designer CONNECT edition - 2019 release 2 Update 7 - Version 10.07.03.18

Regards,

Ryan

Parents Reply Children
No Data