Hi everyone! I'm brand new to MPS and I already have a question. I'm trying to get the SNodeId from an existing file. I can right click the file, get the ID and 'Mock' it on the code and everything wi...
This is an auto-generated question from the MPS Slack community: Hi everyone! I'm brand new to MPS and I already have a question. I'm trying to get the SNodeId from an existing file. I can right click the file, get the ID and 'Mock' it on the code and everything will work... but I'm trying to do it through the code... I was trying to use node-ptr<Test> myVar = node-ptr/....../ .
Is there a way to send a string with the filename and get the NodeId for that file ? Many thanks :slightly_smiling_face:
3 comments
Sort by
Date
Votes
![Avatar](https://secure.gravatar.com/avatar/a729350652a5c69a3eb5f9c45e76fcc3?default=https%3A%2F%2Fassets.zendesk.com%2Fhc%2Fassets%2Fdefault_avatar.png&r=g)
What do you mean by a file? A node? Why do you need SNodeId? Why is node reference, as returned by node-ptr/.../, not enough?
Having said that, you can get the SNodeId by using semantic downcast (`/`) on the node pointer and calling `getNodeId()`.
![Avatar](https://secure.gravatar.com/avatar/bd9751905a467c2d3d685c91ee22dac1?default=https%3A%2F%2Fassets.zendesk.com%2Fhc%2Fassets%2Fdefault_avatar.png&r=g)
problem sorted!!! Thanks Slack user:U6K3FGW3U>
![Avatar](https://secure.gravatar.com/avatar/4a62828c6dff1f40ceedf91d577c1c1b?default=https%3A%2F%2Fassets.zendesk.com%2Fhc%2Fassets%2Fdefault_avatar.png&r=g)
This is auto-generated question from the MPS Community Slack Workspace. If you want to comment on the question, do it from the Slack workspace
Post is closed for comments.