Announcements

Between mid-October and November, the content on AREA will be relocated to the Autodesk Community M&E Hub and the Autodesk Community Gallery. Learn more HERE.

On save prompt to file properties dialogue box

On save prompt to file properties dialogue box

luismestre
Advocate Advocate
792 Views
6 Replies
Message 1 of 7

On save prompt to file properties dialogue box

luismestre
Advocate
Advocate

I'm looking for some help with the following topic:

To make sure all the files have proper metadata I would like to know how to script/change/ 3D studio max to on " Save" prompt the file properties dialogue box.

This action will remind the user to fill in the fields with more metadata before closing the file.

 

All the help will be super appreciated.

Luis Mestre.

Luis Mestre
Oil&Gas Sr.3D & Subsea/Structural Designer
"Autodesk Autocad/Inventor & 3D Studio Max"
Email:lmsmestre@gmail.com
0 Likes
Accepted solutions (1)
793 Views
6 Replies
Replies (6)
Message 2 of 7

denisT.MaxDoctor
Advisor
Advisor

you can use general callback - #filePreSaveProcess (see details in the MXS Help)

 

you can't change the max own saving content or interrupt the saving process, but can popup a modal dialog (YES-NO) with a choice to save metadata

0 Likes
Message 3 of 7

denisT.MaxDoctor
Advisor
Advisor

also you should do the same on #systemPreNew, #systemPreReset, #preSystemShutdown I guess

0 Likes
Message 4 of 7

luismestre
Advocate
Advocate

Hi Dennis 

Appreciate your reply however I need a bit more help ... 

Can you detail a bit more ?

general callback - #filePreSaveProcess (see details in the MXS Help) ????

Luis Mestre
Oil&Gas Sr.3D & Subsea/Structural Designer
"Autodesk Autocad/Inventor & 3D Studio Max"
Email:lmsmestre@gmail.com
0 Likes
Message 5 of 7

luismestre
Advocate
Advocate

I did a start ... will be possible to revise and help ?

I want the event to open the file properties on presave

 

 

 

carbon.png

 

Luis Mestre
Oil&Gas Sr.3D & Subsea/Structural Designer
"Autodesk Autocad/Inventor & 3D Studio Max"
Email:lmsmestre@gmail.com
0 Likes
Message 6 of 7

denisT.MaxDoctor
Advisor
Advisor
Accepted solution

 

fn onPreSaveFile = 
(
	data = callbacks.notificationParam()
	if data[1] == 1 do
	(
		k = fileProperties.findProperty #custom "LastUpdate"
		-- check something first if you really need to add or change properties:
		if (k > 0) then
		(
			-- for example
			curr = localTime
			date = fileProperties.getPropertyValue #custom k
			/* if curr too far from last update do something like:
			fileProperties.addProperty #custom "LastUpdate" localTime
			-- or
			actionMan.executeAction 0 "40374" -- open file property dialog 
			*/
		)
		else
		(
			fileProperties.addProperty #custom "LastUpdate" localTime
			actionMan.executeAction 0 "40374" -- open file property dialog 
		)
	)
)
callbacks.removeScripts id:#my_fileprops_callback
callbacks.addscript #filePreSaveProcess "onPreSaveFile()" id:#my_fileprops_callback  

 

 

here's what you can do...but you have to find a place to put this callback definition. Usually people use some startup ms file, but there may be other options.

 

 

Message 7 of 7

luismestre
Advocate
Advocate

Thanks Dennis.

It works for the purpose.

Luis Mestre
Oil&Gas Sr.3D & Subsea/Structural Designer
"Autodesk Autocad/Inventor & 3D Studio Max"
Email:lmsmestre@gmail.com
0 Likes