Basic C# plugin that displays a palette

Basic C# plugin that displays a palette

Anonymous
Not applicable
1,539 Views
3 Replies
Message 1 of 4

Basic C# plugin that displays a palette

Anonymous
Not applicable

Hi there. I'm relatively new to 3ds plugin development but have worked extensively on AutoCAD, Revit, Inventor etc.

 

What looked to be a straight forward process to add to 3dsmax has become very complex.

 

I've setup a dll with an AssemblyMain, AssemblyInitializationCleanup and AssemblyShutdown. Using the examples code in the documentation I put in some dialog stuff just to get it working in the cleanup routine.

 

 

I'm trying to load a plugin that has dependency DLLs (newtonsoft.json.dll etc.) in 3ds max and have it display a palette based on the documentation it says drop the files into the bin/assemblies folder. When I do this they each error in turn and the one that has the assembly functions errors saying it can't find the other modules.

 

Is there a CURRENT sample for 3ds 2017 or 2018? All I can find is some samples for 2010 and 2012 and there doesn't appear to be any samples at all in the SDK.

 

Any guidance on how to fire up a plugin with dependant dlls and load a pallet with a WPF UserControl in the palette would be hugely appreciated.

 

Thanks!

 

 

 

0 Likes
1,540 Views
3 Replies
Replies (3)
Message 2 of 4

kevinvandecar
Community Manager
Community Manager

Hi,

 

Yes, the bin/assemblies folder is reserved for 3ds Max .NET plugins. You can not put other DLLs there. When you do, 3ds Max will try to load them as 3ds Max .NET API assemblies and then give errors, or worse. I would suggest that you instead put the dependent DLLs in the 3dsmax.exe folder, or better to reference them directly from the main assembly. The App store bundle loader may also be a helpful option with dependent Dlls.

 

Regarding updated code, your question prompted me to update some sample code to 2018. See the below mentioned blog post for some updated sample code. Note this is using the basic CUI system, and not assembly loader (which is more complex to get setup). The sample code creates some actions, and then using the CUI dialog, you can place them in the UI where you want (ie. a new menu, etc.) See the "ADN Samples" category there to find them. The blog post and updated code is here: http://getcoreinterface.typepad.com/blog/2017/10/updated-net-api-samples-for-3ds-max-2018.html

 

For some App Store and bundle examples, see this github repo: https://github.com/ADN-DevTech/3dsMax-Explode-Geometry. This contains an more robust version of the #5 sample code from the blog site, and includes the app store bundle format, complete with a MAXScript to create the menu.

 

hope it helps,

kevin

 

 


Kevin Vandecar
Developer Technical Services
Autodesk Developer Network



0 Likes
Message 3 of 4

Anonymous
Not applicable

Thanks! Just diving into this now. I'll let you know if I have any questions.

0 Likes
Message 4 of 4

Anonymous
Not applicable

I'm a little confused on this one. Here's what I'm trying to do:

 

1. Add a menu/toolbar that will have 2 options on it that I can respond to mouse clicks for.

2. Use the API to get the product and version # information.

3. Load a monitoring plugin that watches for all commands clicked through menus, or executed through typing, or tooltip notifications.

 

From this information we provide context sensitive help in our app. We've successfully done this in AutoCAD, Revit, Navisworks, and Inventor but 3ds documentation is VERY lacking on this front so I'm having trouble figuring out how to hook in, load our plugin with the app, and monitor for these events.

 

Any help would be greatly appreciated.

 

Thanks!

0 Likes