cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Mapkey export to stl

Aquamarine

Mapkey export to stl

 Hi,

 

I've managed to create a mapkey that exports the opened part as *.STL-file. It looks like this:

 

mapkey ä ~ Close `main_dlg_cur` `appl_casc`;~ Command `ProCmdModelSaveAs` ;\
mapkey(continued) ~ Activate `file_saveas` `SAB_..|`;\
mapkey(continued) ~ Select `file_saveas` `ph_list.Filelist` 1 `CreoToStl`;\
mapkey(continued) ~ Activate `file_saveas` `ph_list.Filelist` 1 `CreoToStl`;\
mapkey(continued) ~ Open `file_saveas` `type_option`;~ Close `file_saveas` `type_option`;\
mapkey(continued) ~ Select `file_saveas` `type_option` 1 `db_549`;\
mapkey(continued) ~ Activate `file_saveas` `chk_customize_export` 1;\
mapkey(continued) ~ Select `file_saveas` `ph_list.Filelist` 1 `Klemme_Neu`;\
mapkey(continued) ~ Activate `file_saveas` `ph_list.Filelist` 1 `Klemme_Neu`;\
mapkey(continued) ~ Activate `file_saveas` `OK`;~ Activate `UI Message Dialog` `ok`;\
mapkey(continued) ~ Update `export_slice` `ChordHeightPanel` `0`;\
mapkey(continued) ~ Activate `export_slice` `ChordHeightPanel`;\
mapkey(continued) ~ FocusOut `export_slice` `ChordHeightPanel`;~ Activate `export_slice` `OK`;;

 

The mapkey only works when a part is activated, but I want it to work in an assembly:

 

It has to open every selected part and save it as *.stl.

Is it possible to do that ?

 

Thanks,

Maik 

12 REPLIES 12

Re: Mapkey export to stl

This can be done pretty easily using CREOSON via Javascript or python

 

Basically (psudo code):

 

erase memory

open the assembly you want to process (file : open)

 

parts = (file : list *.prt);

for each part in parts:

  • (model : open) part
  • execute mapkey (interface : mapkey)

done.

 

Hope that helps - any other suggestions?

 

Dave

Re: Mapkey export to stl

Thanks a lot, Dave.

 

I watched the Creoson-installation-video and it seems that J_link has to be installed to use Creoson. I don't know if JLink is installed. Is there a way to check if it is installed or not ? 

Thanks,

Maik

Re: Mapkey export to stl


@MaikTheBike wrote:

Thanks a lot, Dave.

 

I watched the Creoson-installation-video and it seems that J_link has to be installed to use Creoson. I don't know if JLink is installed. Is there a way to check if it is installed or not ? 

Thanks,

Maik


Hi,

for example ... if Creo 6.0.2.0 is installed with J-Link then you will find following files

C:\PTC\CR6_020\Creo 6.0.2.0\Common Files\text\java\otk.jar

C:\PTC\CR6_020\Creo 6.0.2.0\Common Files\text\java\pfcasync.jar


Martin Hanák

Re: Mapkey export to stl

Thank Martin,

 

In the Java-Folder there are 2 Folders:

scripts and simulator

 

and two files:

config.properties, TWXCreoAnalysisProvider.jar

 

so it seems that J-link isn't installed. Maybe you can tell me, how to install it ? 

 

Thanks,

Re: Mapkey export to stl

The CREOSON setup.exe should tell you if JLINK is installed...

 

If it is not installed, simply update Creo Parametric and install the optional API Toolkits and ensure that Creo Object TOOLKIT Java and Jlink are selected.

 

Then you should be able to connect and use it.

 

Dave

Re: Mapkey export to stl


@MaikTheBike wrote:

Thank Martin,

 

In the Java-Folder there are 2 Folders:

scripts and simulator

 

and two files:

config.properties, TWXCreoAnalysisProvider.jar

 

so it seems that J-link isn't installed. Maybe you can tell me, how to install it ? 

 

Thanks,


Hi,
during installation you have to click Configure button and select items mentioned by @DavidBigelow 


Martin Hanák

Re: Mapkey export to stl

the solution is in your project formulation: there is a requirement for programming / scripting.

 

Martin suggested JOTK (formerly Jlink) which requires Java and installing the JOTK module (reconfigure your installation if required).

 

Another solution consists in running ptc_dbatch: this enables to take set of parts stored in a folder and batch run them no more no less. 

This article is extensive about this capability that's shipped with Creo and doesn't require programming, scripting skills: https://www.ptc.com/en/support/article?n=CS133096

 

Finally if you're more comfortable with scripting, you can go for it and leverage the mapkey, but this is another topic. 

Re: Mapkey export to stl

You could write a mapkey to open a single selected part/assembly, export STL, and close window (if desired). And then manually repeat mapkey on a newly selected part. I often add in the open selected command on many of my export mapkeys just in case people want to export selected from an assembly. If nothing if selected, the mapkey will skip the command. Otherwise you're probably looking at programming to loop through all selected.

 

Here's some Mapkey Writing/Editing Tips.

Re: Mapkey export to stl

Thanks for all of your ideas.

 

I ended up opening every model and pressing the mapkey to export the file as STL-File.

Creoson really looks nice. I've installed the Java-toolkit in the Creo installation and was able to download and run the Creoson-examples on Creoson website. So Creoson seems to work.

 

Maybe somebody knows, how I could open every instance of a family table in creoson and export the drawings of these files as .pdf ? And I also would like to Open and render every instance of this family table and save the picture. Is that possible ?

 

Thanks,

Maik

Announcements