[OR 2019 R2] SmartObjects Project Customized for Ss4 - Migrated to ORD and Working Code Fails

We have code that worked in Ss4 for Survey. We modified the VBA Annotations to read Element Templates as part of the command line arguments.

This is the VBA Macro code line that is used in ORD that worked in Ss4/OR

Survey,SHA0201,DrawAndLabel3dPipe,3D\Drainage\Pipe\Existing,Survey\Label\Storm Pipe,PINV,12 

In the module and procedure that this runs, is a call to a label generating code. In it is a call to this code, where the error occurs. The purpose is to not only use the element template for its settings, but to make sure the text label that is generated has its template property set to match. We are able to set the active element template using the same text string, but we cannot set the newly create element so its Template property matches.

Public Function SetPropertyValue(ByRef oEl As Element, propertyName As String, propertyValue As String) As Boolean
    On Error GoTo Handle_Error
    
    Dim ph As PropertyHandler
    Set ph = CreatePropertyHandler(oEl)
    
    Dim accstr() As String
    accstr = ph.GetAccessStrings
    
    If ph.SelectByAccessString(propertyName) Then
        ph.SetValue propertyValue
    End If
    
    oEl.Rewrite
    
    SetPropertyValue = True
    
Exit_Sub:
    Exit Function
Handle_Error:
    LogError m_Module, "SetPropertyValue: " & propertyName & "=" & propertyValue
    GoTo Exit_Sub
End Function

Here is an entry from the error log we write:

10/03/2019 11:32:20 AM CRheault SHAOHDPCEXXXXX [Survey]SHA 02.01.00 - SetPropertyValue: Template=Survey\Label\Sanitary ERROR -2147218366: Not available

Parents Reply Children
No Data