Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

AF SDK Reference

AFModel Constructor (String, AFElementTemplate)

  • Last UpdatedNov 18, 2025
  • 2 minute read
AFModel Constructor (String, AFElementTemplate)
Initializes a new instance of the class with the specified name.

Namespace:  OSIsoft.AF.Modeling
Assembly:  OSIsoft.AFSDK (in OSIsoft.AFSDK.dll) Version: 3.1.1.1182

Syntax

public AFModel(
	string name,
	AFElementTemplate template
)
Public Sub New ( 
	name As String,
	template As AFElementTemplate
)

Dim name As String
Dim template As AFElementTemplate

Dim instance As New AFModel(name, template)
public:
AFModel(
	String^ name, 
	AFElementTemplate^ template
)
new : 
        name : string * 
        template : AFElementTemplate -> AFModel

Parameters

name
Type: SystemString
The name of the newly created instance of the class. See the ValidateName(String, String) method for a description of what is valid when setting the name of the object.
template
Type: OSIsoft.AF.AssetAFElementTemplate
The AFElementTemplate that is to be used to create a new instance of the AFModel object. The template must have its InstanceType set to AFModel. If , then the element is created without a template and properties normally defined by the template will be defined by the element instead.

Remarks

The instance of the class created using this constructor does not belong to any collection. To add the object to a collection, use the collection's Add method.

Version Information

AFSDK


See Also

In This Topic
TitleResults for “How to create a CRG?”Also Available in