InformationModel.MakeObjectType<T>(browseName, superTypeId)
Creates a project object type derived from the type indicated in the second argument (supertype) and returns a C# object of the specified
<T>
type.
TIP:
At design time, the API functions only if the specified type is a predefined type (contained in the FTOptix modules).
static T MakeObjectType<T>(QualifiedNamebrowseName, NodeIdsuperTypeId);
Arguments
- T
- AnIUAObjectC# class that corresponds to the class of the C# object to return.
- browseName(QualifiedName)
- TheBrowseNameof the new object.
- superTypeId(NodeId)
- TheNodeIDof the type from which the new object is derived.
Returns
- T
- A C# object that corresponds to the project object created.
Example
The following example shows an API that creates a
NewMotorType
object of the Motor
type, searched with the Find
method, and then specified using NodeID
that returns a MotorType
C# object:var supertype = Project.Current.Find("Motor"); var myObj = InformationModel.MakeObjectType<MotorType>("NewMotorType", supertype.NodeId); Owner.Add(myObj);
Provide Feedback