Import automatically by code .STL files

Moderator: GiD Team

Freddy
Posts: 3
Joined: Wed Oct 04, 2017 2:17 am

Import automatically by code .STL files

Postby Freddy » Mon Oct 09, 2017 1:07 am

It is possible to import several files in .stl format by code :?:
User avatar
escolano
Posts: 1568
Joined: Thu Sep 18, 2014 3:31 pm

Re: Import automatically by code .STL files

Postby escolano » Mon Oct 09, 2017 11:15 am

You can select multiple .stl files in the Windows file browser and draw them over GiD. All of them fill be imported as stl.

By code, at Tcl level, you can import a stl file with
GiD_Process MEscape Files STLRead $filename escape
if there is some previous mesh, before get the name GiD will ask a question:
"Old mesh exists: Erase, Append, Cancel"
you must anticipate it and provide the answer you want, e.g. to append must use the word AddNoShare:
GiD_Process MEscape Files STLRead AddNoShare $filename escape

Note: You can know if a previous mesh exists with [lindex [GiD_Info mesh] 0] that is the number of meshes

Note: In general, you can know the keywords of the process commands used by GiD doing the operation as user and opening the 'Undo' window (Utilities->Undo...), here you will see in this case the words MEscape Files STLRead AddNoShare $filename escape (where filename is the final name, not a Tcl variable like my code example)
Freddy
Posts: 3
Joined: Wed Oct 04, 2017 2:17 am

Re: Import automatically by code .STL files

Postby Freddy » Mon Oct 09, 2017 3:31 pm

Perfect. Thank you very much! :D

Return to “Import/Export”

Who is online

Users browsing this forum: No registered users and 2 guests