Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
ekinsb
in reply to: Anonymous

Fortunately the STL format is fairly simple so it's not too difficult to write an STL file.  I just saw your question and do have some information that will hopefully at least benefit someone else that finds this in a search. 

 

DataIO is very limited in the file formats it supports.  It doesn't support STL or STEP.  Instead of DataIO you can use one of the Inventor translators if you want to control all of the various options or if you're happy with the defaults you can just use the SaveAs method where the filename has the appropriate extension and the second argument is True to indicate you're doing a Save Copy As. 

 

The other option is to use the STL translator.  This is the same translator that's used when you interactively save an STL file and give you all of the various options to control the output mesh.  One limitation with both Save Copy As and the STL translator is that Inventor always writes out the entire part.  You can't specify a specific body.  A workaround to this is to copy the desired body into another part so it's the only body and then export that part.  There are several samples in the API help that illustrate using the translator add-in interface.  Unfortunately, there aren't any that demonstrate exporting to STL but it's the same as the other types except the options are different.  You can find a list of the options in the API help.  If you search for "Translator Options" you'll find a topic with that same tiltle that lists all of the options for the translator add-ins.

 

 


Brian Ekins
Inventor and Fusion 360 API Expert
Mod the Machine blog