ExportFile not working?

ExportFile not working?

Steve_Curley
Mentor Mentor
422 Views
3 Replies
Message 1 of 4

ExportFile not working?

Steve_Curley
Mentor
Mentor
As per the attached images, exporting to a .3ds appears to work (as does .obj btw), any attempt to export to a .stl does not.

Either I'm missing something blindingly obvious or the exportFile function simply doesn't work for stl files. Any help appreciated (trying to answer a question in another thread but this has stopped me dead in my tracks 😞 ).

Note. Tested in several versions with the same results. Primary testing done in Max 2009 (32bit).


Max 2016 (SP1/EXT1)
Win7Pro x64 (SP1). i5-3570K @ 4.4GHz, 8Gb Ram, DX11.
nVidia GTX760 (2GB) (Driver 430.86).

0 Likes
423 Views
3 Replies
Replies (3)
Message 2 of 4

Anonymous
Not applicable
I got it working in 3dsmax 2009 using this:


exportFile ((GetDir #export) + "/expTest.stl")



- First it seems the STL exporter does not support exportSelected. I noticed when doing File->Export Selected the STL option goes away. (You may have to try hiding everything but selected to get the same result with exporting all).

- Max automatically figures out which exporter to use based on the file's extension that you provide, so I'm not sure why you need to define fType.

- Also (GetDir #export + blah) doesn't work, it should be ((GetDir #export) + blah).
0 Likes
Message 3 of 4

Steve_Curley
Mentor
Mentor
Thanks for looking, however...

File > Export > <filename.stl> brings up a dialog which includes "export selected" as an option (see image). I had alreay noticed that there's no STL option in File > Export Selected. The Help (for exportFile) is therefore incorrect in that is gives no warning or mention of that parameter being applicable to certain filetypes only.

I was trying to get around the rather odd error message by forcing the exporter to use a specific plugin. Agreed it is not strictly necessary, but doesn't appear to have any impact one way or the other.

Technically, yes - I missed a pair of parenthesis, but it does work with or without (I just tested it). MXS is weird like that - sometimes stuff works (when it shouldn't) and sometimes it doesn't (when it should).

The real issue is definitely the selectedOnly:true bit. That is a real problem, because the requirement is for exporting each selected object into an STL file with the same filename as the name of the object being exported. There are 700+ of them so doing it (manually) one at a time is not an option.

The only way I can see, at present, to achieve that would be if there is some way to directly access the dialog - if there is, I don't know it. Any ideas?

Just found DialogMonitorOPS and the UIAccessor interface - looks like I have some reading to do...


Max 2016 (SP1/EXT1)
Win7Pro x64 (SP1). i5-3570K @ 4.4GHz, 8Gb Ram, DX11.
nVidia GTX760 (2GB) (Driver 430.86).

0 Likes
Message 4 of 4

Steve_Curley
Mentor
Mentor
I think I worked out how to do it. Rather than post the solution twice, please see this thread which is why I was looking at this in the first place.

Max 2016 (SP1/EXT1)
Win7Pro x64 (SP1). i5-3570K @ 4.4GHz, 8Gb Ram, DX11.
nVidia GTX760 (2GB) (Driver 430.86).

0 Likes