Hi All,
I am trying to write a VBA code that changes the Feature Name and Feature Definition of a Terrain however I am running into some issues .
When I run the code below I get an "Unknown error" when "X" is "FeatureName" or "FeatureDefinition" in the line:
If (True = ph.SelectByAccessString("X")) Then
However, when I change the value of "X" in that line to "Transparency", "Priority", "Level" etc it works as expected.
Is there something I need to change in the code to allow the "FeatureName" and/or "FeatureDefinition" to be changed or is it not possible to change those values using VBA?
If people have any suggestions on how I could change the Feature Name (ideally I want the Feature Name of the Terrain to be the same as the .dgn it is in) and Feature Definition of a Terrain in an Automated manner that would be appreciated.
Sub SET_ACCESS_STRING_VALUE() Dim ee As ElementEnumerator Set ee = ActiveModelReference.GraphicalElementCache.Scan Do While ee.MoveNext Dim ph As PropertyHandler Set ph = CreatePropertyHandler(ee.Current) Dim accstr() As String accstr = ph.GetAccessStrings If (True = ph.SelectByAccessString("FeatureName")) Then ph.setValue "NEWNAME" End If Loop End Sub
Software:
OpenRoads Designer CONNECT Edition - 2019 Release 2 update 7 - Version 10.07.03.18
Regards,
Ryan
Hi Ryan,
Unfortunately it seems that these property handlers are read-only. I gave up on using VBA on these type of operations a while ago after running into too many brick walls.
Mark
OpenRoads Designer 2023 | Microstation 2023.2 | ProjectWise 2023
Thanks Mark,
I wasn't sure if it was my lack of knowledge or the tasks were not possible.
It is disappointing as it is almost possible to create some macros that would really help with outputting ORD designs.