AnsweredAssumed Answered

FabricationLayerText.LayerName returns blank?

Question asked by lennart.edenfjord1 on Apr 8, 2020
Latest reply on Apr 8, 2020 by lennart.edenfjord1

I'm looking for a text that should be present on either soldermask or silkscreen, top or bottom.

 

Finding the text is not a problem, but how do I determine what layer it is on?

This is my test code:

************************************************

Set App = Application
Set Doc = App.ActiveDocument

 

Doc.Validate(CreateObject("MGCPCBAutomationLicensing.Application").GetToken(Doc.Validate(0)))

 

    Dim oFabText, fabTextLayer, fabTextFound, oProp
    
    fabTextFound = False
    
    For Each oFabText in Doc.FabricationLayerTexts
    
        If InStr(oFabText.TextString, "MFG") Then

 

            MsgOutput(oFabText.Name)            
            MsgOutput(oFabText.TextString)
            MsgOutput(oFabText.Layer)
            MsgOutput(oFabText.LayerName)
            MsgOutput(oFabText.Side)
            MsgOutput(oFabText.SideName)
            
            
            For Each oProp in oFabText.Properties
            
                MsgOutput(oProp.Name & "=" & oProp.Value)
            
            Next
            
            fabTextFound = True
            
        End If
    
    Next
    
    If Not fabTextFound Then
    
        MsgOutput("String not found.")
        
    End If
    
Sub MsgOutput(msgString)

 

    App.Addins("Message Window").Control.AddTab("FabTextTest").AppendText(msgString & vbCrLf)

 

End Sub

************************************************

 

The output from this is:

PCB MFG
PCB MFG
-99

1
Top
TEXT_LINE_SPACING=1.70
TEXT_ASPECT_RATIO=1.000
(Notice the blank line from LayerName.)
What I was hoping to find:

Outcomes