AnsweredAssumed Answered

Usage of the PutFabricationLayerTextOnLayer method in Cell Editor 

Question asked by peter_festesen on Nov 17, 2017
Latest reply on Nov 17, 2017 by peter_festesen

Hi - does anyone here have experience with the

PutFabricationLayerTextOnLayer method.

 

Our intention is to use it to add a property to a existing user layer in the cell in Cell Editor.  Our expectation is to mimic the  Cell Editor 'Draw-Property Text' feature to add a number of properties to a user draft layer

Documentation says:

Function PutFabricationLayerTextOnLayer(sString As String, PositionX As Double, PositionY As Double, eTextType As EPcbTextType, eType As EPcbFabricationType, eSide As EPcbSide, [pLayerObject As LayerObject], [pComponent As Component], [eUnit As EPcbUnit = epcbUnitCurrent]) As FabricationLayerText

 

where

pLayer - parameter is only used for flex designs and soldermask text (which we are not using) . We have tried omitting, setting it to the appropriate layer object and also tried 'Nothing as the object.

pComponent - must be sepcified. As thgis is cell editor, we use 'Nothing' as the component object

 

In order to avoid trouble regarding enumerated types, we use the numbers instead. Both the propety 'Tolerance' and the NewPF User Draft layer do exist.

 

The key code :

For each objUserLayer in objActiveDoc.UserLayers

     If objUserLayer.Name = "NewPF" Then

          Set objLayer=objUserLayer

          MsgBox objLayer.Name & " found, trying to add property"

     End if

Next

'epcbTextPartProperty = 64

'epcbFabAssembly = 1

'epcbSideMount = 513

 

Set strLayerText = objActiveDoc.PutFabricationLayerTextOnLayer("Tolerance",0,0,64,1,513,Nothing,Nothing,0)

 

The last line fails with 'Invalid Parameters'

 

If we use

Set strLayerText = objActiveDoc.PutFabricationLayerTextOnLayer("Tolerance",0,0,64,1,513,objLayer,Nothing,0)

 

gives us 'Type Mismatch error

 

Any hints that help us move forward are highly appreciated.

Outcomes