Notifications
Clear all

[Closed] IINodeTab

When I am using c# to develop a plug-in,I found a confusing question.Using Autodesk.Max in 3dsmax 2017,there is a method that

IINodeTab nodetab = g.NodeTab.Create()

but in 3dsmax 2022,there is another method that

IINodeTab nodetab = g.INodeTab.Create()

How can I use a method in both max2017 and max2022
thank you!

4 Replies

get the Type using reflection and then invoke the Create method

btw, quite confusing thread name, isn’t it? Hardly useful for anyone who might have same problem as you

Can you give me a example?

1 Reply
(@serejah)
Joined: 10 months ago

Posts: 0

it is a maxscript code but in c# it has to be very similar

g = (dotNetClass "Autodesk.Max.GlobalInterface").Instance
t = g.gettype()

node_tab = for p in t.DeclaredProperties where matchpattern p.Name pattern:"*NodeTab*" collect p.Name

print node_tab

prop = t.GetProperty "NodeTab"
NodeTab_create = prop.PropertyType.GetMethod "Create"

NodeTab_create.invoke (prop.getvalue g) (dotNet.ValueToDotNetObject #() (dotNetClass "system.object[]"))

nice! I made it. You’re such a good teacher