Using the Process Analyst > Process Analyst for Developers > Automation Model > IPens.Create [Method]

IPens.Create [Method]

Creates a new pen and adds it to this collection.

Defined As



[in] Indicates the type of pen that will be created. See PenType Enumeration for the types of pen that can be created.


[in] Indicates how the name will be obtained for this pen. The Process Analyst provides options of PenNameMode_Comment, PenNameMode_Tag, and PenNameMode_Custom. Specifying PenNameMode_Comment will mean that the Process Analyst names the pen from the Comment field of the trend/alarm tag associated with the IPen.DataPoint property. Specifying PenNameMode_Tag will mean that the Process Analyst will name the pen as the value of the IPen.DataPoint property. Specifying PenNameMode_Custom causes the Process Analyst to provide a default name and leave setting the name to you via the IPen.Name property.

Execution Results

If the method succeeds the return value will be Success. If the pens collection is deleted, the return value will be GeneralFailure.


If this method succeeds, a new Pen of the specified type is created and appended to the pens collection.

See Also

IPen Interface, PenType [Enumeration], PenNameMode [Enumeration]

Calling Syntax

This example assumes there is a valid Pens collection object to be passed in to the example methods.


Sub Example(pens As Object)
Dim pen As Object
Set pen = pens.Create(4097, 1)
End Sub


OBJECT hPen = _ObjectCallMethod(hPens, "Create" , 4097, 1);