To assign numeric NodeId when I instantiate Custom Object Type
Posted: 19 May 2023, 08:44
Dear Team,
When I write codes to create my custom object type and make multiple instances from that type,
I would write as follows:
var settings = new CreateObjectSettings()
{
ParentNodeId = parentFolder.NodeId,
ReferenceTypeId = ReferenceTypeIds.Organizes,
RequestedNodeId = new NodeId($"OBJ_{i:D3}", InstanceNamespaceIndex),
BrowseName = new QualifiedName($"OBJ_{i:D3}", InstanceNamespaceIndex),
TypeDefinitionId = new NodeId(MY_CUSTOM_OBJECT_TYPE_ID, TypeNamespaceIndex)
};
CreateObject(_serverNodeManager.Server.DefaultRequestContext, settings);
When you do this, all the node ids of the nodes under the objects instantiated from "MY_CUSTOM_OBJECT_TYPE_ID" are "string" type.
The string node id which actually is the path of the node (like BrowseName).
I want to assign numeric node id (for better performance)...
Is there any way for me to jump in the process creating the nodes and give numeric node id for each child nodes when they are instantiated?
P.S.
When I worked with UA Modeler, I could assign numeric node ids for all the custome object types and I could see all the instantiated objects has nodes with numeric node ids...
When I write codes to create my custom object type and make multiple instances from that type,
I would write as follows:
var settings = new CreateObjectSettings()
{
ParentNodeId = parentFolder.NodeId,
ReferenceTypeId = ReferenceTypeIds.Organizes,
RequestedNodeId = new NodeId($"OBJ_{i:D3}", InstanceNamespaceIndex),
BrowseName = new QualifiedName($"OBJ_{i:D3}", InstanceNamespaceIndex),
TypeDefinitionId = new NodeId(MY_CUSTOM_OBJECT_TYPE_ID, TypeNamespaceIndex)
};
CreateObject(_serverNodeManager.Server.DefaultRequestContext, settings);
When you do this, all the node ids of the nodes under the objects instantiated from "MY_CUSTOM_OBJECT_TYPE_ID" are "string" type.
The string node id which actually is the path of the node (like BrowseName).
I want to assign numeric node id (for better performance)...
Is there any way for me to jump in the process creating the nodes and give numeric node id for each child nodes when they are instantiated?
P.S.
When I worked with UA Modeler, I could assign numeric node ids for all the custome object types and I could see all the instantiated objects has nodes with numeric node ids...