How to read File Properties -> Custom -> Used Plug-ins data from a .max file without opening it?

miauuuu
Collaborator
Collaborator

How to read File Properties -> Custom -> Used Plug-ins data from a .max file without opening it?

miauuuu
Collaborator
Collaborator

I would like to read, using maxscript,  the "File Properties - Custom - Used Plug-ins" data from a .max file without opening the file in 3ds max.

What I have tested so far:

- CalumMcLellan.StructuredStorage.dll, using the sample code, provided by denisT in this thread.

- OpenMcdf.dll

- DSOFile.dll

 

but with no success. I can get some data, but not the "Used Plug-ins".

 

 

https://miauu-maxscript.com/
0 Likes
Reply
Accepted solutions (1)
890 Views
7 Replies
Replies (7)

Serejah
Advocate
Advocate
Accepted solution

openmcdf definitely can read this data stream

 

 

// https://learn.microsoft.com/en-us/windows/win32/stg/the-documentsummaryinformation-and-userdefined-property-sets

CompoundFile cf = new CompoundFile(@"C:\...\test.max");

var stream_name = $"{((char)0x05)}DocumentSummaryInformation";

CFStream fs;

if ( cf.RootStorage.TryGetStream(stream_name, out fs) )
{
	byte[] bytes = fs.GetData();
	Console.WriteLine( Encoding.Default.GetString( bytes ) );	
}

cf.Close();	

 

 

 

 

 

and btw, AutodeskAssetLibrary tool has this c# dll that has some useful methods like the one you need

Serejah_0-1669305431173.png

 

 

0 Likes

miauuuu
Collaborator
Collaborator

Thank you, @Serejah!

Will test it tomorrow.

 

Side question - is there any way to read all those methods from the dll files without opening them one by one until we find what we need?

https://miauu-maxscript.com/
0 Likes

Serejah
Advocate
Advocate

@miauuuu  написал (-а):

is there any way to read all those methods from the dll files without opening them one by one until we find what we need?


If you want to do it with maxscript inside max then you'll have to load the assembly anyway. Then using reflection you can get all the needed info about properties/methods of a particular class. There're a lot of examples on the web

 

But the most convenient way to analyze dlls is searching for documentation or browsing them with tools like dnSpy, DotPeek, Visual Studio Object Browser and I believe there're many more others

0 Likes

miauuuu
Collaborator
Collaborator

I can't find MaxFileUtilitiesDotNet.dll anywhere. I assume it is installed when the AssetLibrary tool is being installed, but this tool is no longer available for download from the Autodesk App store. Is there any chance to share the tool if you have it?

https://miauu-maxscript.com/
0 Likes

Serejah
Advocate
Advocate

@miauuuu  написал (-а):

I can't find MaxFileUtilitiesDotNet.dll anywhere.


MaxFileUtilitiesDotNet.dll is a .net wrapper dll for MaxFileUtilities.dll so you need to have both of them

Check your cgtalk PM 😉

0 Likes

miauuuu
Collaborator
Collaborator

Thank you, Serejah!

https://miauu-maxscript.com/
0 Likes

miauuuu
Collaborator
Collaborator

Hey, Serejah check your cgtalk PM?

https://miauu-maxscript.com/
0 Likes