View Full Version : SDK - Get INodeLayerProperties from INode

03 March 2012, 10:59 AM
I'm trying to get the INodeLayerProperties interface from an INode. In the SDK help it says:
Now I notice that it casts to INodeGIProperties, which I assume is a typo and should be INodeLayerProperties. But even without the cast, the GetInterface returns a null pointer.

I found that I could get an ILayer from an INode using
ILayer* aLayer = (ILayer*) node->GetReference(NODE_LAYER_REF);
But this I'm not sure if or how I could get an INodeLayerProperties object from that...

The reason I'm looking for the INodeLayerProperties is that I want to use the ILayerProperties interface to get all nodes on a layer. And I've also noticed some strange behavior when undoing an ILayer.AddToLayer(node) operation, so I want to see if it might work better with an ILayerProperties.AddNode.


03 March 2012, 10:38 PM
i try the following in my exporter, it worked (in that it showed up the correct name and color in the debugger) so probably is a misprint.

INodeLayerProperties* node_layer_props = static_cast<INodeLayerProperties*>(maxnode->GetInterface(NODELAYERPROPERTIES_INTERFACE));
ILayerProperties* layer_props = node_layer_props->getLayer();
MCHAR* lname = layer_props->getName();
Color c = layer_props->getWireColor();

maxnode is INode* type

03 March 2012, 09:19 PM
Thanks for your reply.
The problem I'm having is that this seems to return a null-pointer for me:
So that's just getting the baseinterface; even before the cast.

03 March 2012, 08:40 PM
are you certain maxnode is a valid INode* ?

CGTalk Moderation
03 March 2012, 08:40 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.