NodeUserData & LinkModelToNode

Questions regarding the use of the .NET SDK 2.0 for Server or Client development or integration into customer products ...

Moderator: uasdknet

Post Reply
pfay
Sr. Member
Sr. Member
Posts: 12
Joined: 10 Dec 2013, 11:52

NodeUserData & LinkModelToNode

Post by pfay »

Hi,

I am trying to add user data to a nodeId and to also link this nodeId with a model, I can achieve both separately but not together. When I add user data first, then link a model to this node, the user data is not added. When I try in the reverse order the user data is added but the model is not link to the node. Is there a special method for achieving this or am i missing something.

// Example
// Link model with node
ModelHandle modelHandle = LinkModelToNode(nodeId, obj, null, null, 500);

// Add user data to node
UserData data = new UserData();
data.modelHandle = modelHandle;
SetNodeUserData(nodeId, data);

Ultimately I am trying to attach a model handle to a nodeId so I can access the in memory model from the nodeId at a later stage.

Thanks for any suuport.....

User avatar
Support Team
Hero Member
Hero Member
Posts: 3072
Joined: 18 Mar 2011, 15:09

Re: NodeUserData & LinkModelToNode

Post by Support Team »

Hello,

If you use LinkModelToNode the model to a node the SDK needs the UserData so you cannot set it.
If you need UserData in this situation you should add it to the Model object which you are linking.
The expectation is the model object can contain whatever UserData you need.
Can you describe the context where you have access to the Node UserData but not the Model object?

Best regards
Support Team

Post Reply