Notifications
Clear all

[Closed] Exporting to .dxf

I tried to use the search on cgtalk but its all bonkers.

I’m looking for a way to export a 3d max file into a .dxf file through maxscript. However I can’t find ANYTHING online about that.

I have a 3ds export script and thought i would just replace the .3ds part into .dxf hoping that would just be a quick edit but of course its more complicated than that.

(
theClasses = exporterPlugin.classes
exportFile ( path_out +”\”+(getFilenameFile maxfilename)+”.dxf”) #noPrompt using:theClasses[1]
)

Any help in the right direction would be much appreciated.

4 Replies

Got it to work using the following

exportFile (maxFilePath+”\”+(getFilenameFile maxfilename)+ “.dxf”) #noPrompt selectedOnly:false using:theClasses[4]

How/where do I control to export it in 2004 version with all geometry options unchecked?

Also id love to know what

using:theClasses[4]

does. Even if I change it to 1 it will still export to .dxf, so what does it really do?

Hi,

you shouldn’t use the class array and an index as there might be other plugins installed over time or they are different on different machines.
If you type exporterPlugin.classes into the listener you see all available exporter classes. Use those names for that export, like
exportFile (maxFilePath+"\"+(getFilenameFile maxfilename)+ ".stl") #noPrompt selectedOnly:false using:STL_Export
where STL_Export will popup when showing the classes in the listener. Unfortunately I don’t see which exporter name is used for DXF but I think you will find out.

Interesting, so if I would use the classes array and move the script to a different machine it would not work because the available exporter classes are in a different order? Tricky.

Anyway, I got the script working but unfortunately have to use the prompt as i cant find a way to edit the export settings through maxscript. Thanks for the help

exportFile (maxFilePath+”\”+(getFilenameFile maxfilename)+ “.dxf”) —#noPrompt selectedOnly:false using:theClasses[1]

It MAY be a different order… yes. Think of a different/new 3ds Max version, that has a new exporter added, so the amount of classes and the order is different.

What you could do about the prompt problem: in a loop you only show the prompt the very first step. The settings you make in this export prompt/dialog in the first step will stick until the end of the loop.