[ph...] Posted April 29, 2021 Share Posted April 29, 2021 Hi , i am using a script which imports a .catpart from a nominated folder the CAD part is made up of multiple components and then i export in stl format and select 'multiple parts' ready for 3d printing. Each component of the .catpart then is assigned the name of the original part with externsion 00 , 01 , 02 etc. is there a way of naming each stl as the components listed under the main CAD part? Link to comment Share on other sites More sharing options...
[An...] Posted April 29, 2021 Share Posted April 29, 2021 Hello Phil, maybe something like this will help you... # -*- coding: utf-8 -*- import gom # Default directory DIR = 'C:/tmp/' # loop over all parts for part in gom.app.project.parts: # loop over all bodies for body in part.nominal.bodies: # get the name of the body name = body.name # export the body into a stl file with the name of the body gom.script.sys.export_stl ( bgr_coding=False, binary=True, color=False, elements=body, export_in_one_file=True, export_stages_mode='current', file=DIR+name+'.stl', length_unit='default', set_stl_color_bit=False) Link to comment Share on other sites More sharing options...
[ph...] Posted May 26, 2021 Author Share Posted May 26, 2021 thanks Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in