Skip to main content
12-Amethyst
September 21, 2014
Question

Trailmaker 0.3

  • September 21, 2014
  • 17 replies
  • 30418 views

Trailmaker is now a collection of small utilities:

1 - Trailmaker

A script to build customized trailfiles, to process files in batch mode.

Here some ideas that you can make this script work for you:

Export multiple parts to Step/Iges

Import multiple Iges/Steps to Prt´s

Export multiple Drawings to DXF/DWG/PDF

Export/verify all instances of a family table

Bring multiple parts/drawings into session

Plot a lot of drawings

Run a mapkey

Change/add/delete Parameters

Modify Units/Mass Properties

Create Jpeg´s of multiple parts

Mix all this together...

Lots of possibilities.

Video Link : 5303

2 - Assembler

Script to assemble components (by default) in a assembly in batch mode;

3 - FT-Drawing

Script to create drawings for each instance of a family table;

Video Link : 5305

4 - New_Drw

Script to create a new drawing with same name of the active model;

4 - Open_Drw

Script to open a existing drawing with same name of the active model;

Download link:

https://www.dropbox.com/s/nprv7wx6u2iog2n/TrailMaker.zip?dl=0

Open Readme.txt for more instructions.

Cheers

Jose

17 replies

10-Marble
September 21, 2014

Jose,

Finally I got some free time and managed to run your script. The problem was in that we use "p" mapkey for printing drawings, so that was the reason for loop, because p was ommited and "trail" portion was run again.

Thank you!

12-Amethyst
September 21, 2014

Humm.. conflicting mapkeys.

One character mapkeys are dangerous because of that.

Nice to know that it´s working for you too.

1-Visitor
September 22, 2014

Jose, this looks interesting....!

Can you please share how did you make this utility?

Thanks,

Sachin

10-Marble
September 22, 2014

It is working!!!!

BUT, is it possible to add an option to select a FOLDER where PDF/DWG/STEP files will be placed?

12-Amethyst
September 22, 2014

That option will be available in the paid version .

Now seriously, you just have to edit the trail.

Example, file prt2step.txt

!Export Step Files

~ Command `ProCmdModelSaveAs`

~ Update `file_saveas` `opt_EMBED_BROWSER_TB_SAB_LAYOUT` `C:\\Export\\Steps`

~ Activate `file_saveas` `opt_EMBED_BROWSER_TB_SAB_LAYOUT`

~ Select `file_saveas` `type_option` 1 `db_539`

~ Activate `file_saveas` `OK`

~ Activate `intf_export` `solids` 1

~ Activate `intf_export` `OkPushBtn`

Adding the two bold lines will define the destination directory. Just correct the path to yours.

Repeat for the other trails

16-Pearl
September 23, 2014

Great job Jose !!!

I'm realy impressed.

But one question because I've faced with this issue some time ago, and I got stuck.

What in case, where a combined view is placed on drawing?? Question comes from one of my customer. He creates sheetmetal parts. As you know smt parts have two states (bended/unbended). It will be greate to create drw with two sheets, where first sheet shows bended part, and second unbended (used for export to dxf). Unbended state is created by simplify representation, an on drawing combined view is shown -that contains REP. Problem is, that in Creo there is impossible to replace model in drawing, if one of representation is used.

Case: smt part with family table inside, and drw created form generic with two states/sheets. Then, with some magic button for all instances documentation is created.

Do you have any idea how to solved it?

Regards,

Chris

12-Amethyst
September 23, 2014

Don´t have sheetmetal, but if I have time, i´ll try to recreate with standard part.

12-Amethyst
October 8, 2014

I added a new file: Trailmaker.ini

Download the full package again and edit this file. Put your path there.

Then you have to correct the path in the mapkeys too.

Done

Jose

12-Amethyst
October 22, 2014

I added a new script:

RM - Replace model in drawing.

Ever wanted to replace a model in a drawing with less clicks? here it is.

16-Pearl
October 23, 2014

Hi Jose,

again - I'm impressed. Great job. Your scripts are very useful and helpful

But unfortunately, last one (RM) ends with error: Trail file out of sequence at line 31.

Could you please look at it, or tell me what I'm doing wrong??

THX

12-Amethyst
October 23, 2014

You´re right, I tested it here, and sometimes it doesn´t work correctly. I have to enhance it a little bit more. But not for now, I´m short in time...

Jose

1-Visitor
May 17, 2015

Jose,

would it be possible to filter parts for iges/step export not according to their model name but according to other parameter (in my case "&asm.mbr.POZICE")? T.

12-Amethyst
September 28, 2015

Sorry for the late reply,

To do that you don't need a automation tool.

1 - Open the assembly

2 - Use the search tool to select the components you want, like this.

3 - Set representation->master (to isolate the comps)

4 - Save a copy - > Step/Iges ->  File Structure -Separate parts only

2015-09-28 21_25_12-Export STEP.png

If you still want to use trailmaker instead, I don't have a good idea for that.

I believe you can filter your parts and save a simplified rep. Then close the assembly, clean up memory, open that simplified rep and export all the parts in session.

Jose

1-Visitor
September 28, 2015

Hi Jose,

Great one.

I have one request. Hope you may guide for the same.

If there are 10 parts and if I need 10 drawing for those respective parts.The DRW mapkey is not solving the issue.

I used several mapkey to continue after drw, unfortunately the drawings are not creating.

Let me know is there something that as to be modified.

Regards,

Murali

12-Amethyst
September 28, 2015

Yes, you're right.

The Drw mapkey is a semi automatic routine, because it stops for allowing the user to choose a format or a template.

You pretend a full automated process.

Take a look on the the atached file, I'm assuming you are using a template.

In line 9 replace text "Template" with your template name, then fire Trailmaker and use this file. It should work.

Jose

1-Visitor
October 1, 2015

Hi Jose,

The issue was resolved. I was using WF5.

Please find the attached mapkeys.pro and run_mapykey.txt.

I have created an mapkey ndrw which does an automatic drawing creation. When typed ndrw.

When using the Trailmaker I am unable to get the mapkey run.

Run_mapkey.txt

!Run a mapkey. Change text `Mapkey key here`. The Mapkey can´t contain pauses.

~ Command `ProCmdUtilMacros`;\

~ Activate `mapkey_main` `mapkey_main`

~ Select `mapkey_main` `list_mapkeys` 1 `ndrw`

~ Activate `mapkey_main` `RunButton`

~ Activate `mapkey_main` `mapkey_main`

~ Activate `mapkey_main` `CloseButton`

Mapkey

mapkey ndrw %drw;%cd;%swc;

mapkey drw @MAPKEY_NAMECreates a drawing with the name of active model;\

mapkey(continued) ~ Command `ProCmdModelNew`

mapkey(continued) ~ Select `new` `Type` 1 `Drawing`;\

mapkey(continued) @MAPKEY_LABELDrawing;@SYSTEMStart C:\\TrailMaker\\new_drw.exe;

mapkey >partname @MAPKEY_NAMEGets partname;~ Command `ProCmdModelSaveAs`

mapkey(continued) ~ Select `file_saveas` `type_option` 1 `db_129`;\

mapkey(continued) ~ Activate `file_saveas` `OK`;~ Activate `UI Message Dialog` `ok`;\

mapkey(continued) @SYSTEMdel sw.pro\ndir /b *.pic>filename.txt\nset /p VAR1=<filename.txt\ndel \

mapkey(continued) filename.txt\nSET FILENAME=\%VAR1:\~0,-4\%\necho mapkey partname \~ Update \

mapkey(continued) `new` `InputPanel1` `%FILENAME%`\;>>sw.pro\ndel *.pic;

mapkey load @MAPKEY_NAMEload mapkey into config;\

mapkey(continued) ~ Command `ProCmdRibbonOptionsDlg`

mapkey(continued) ~ Select `ribbon_options_dialog` `PageSwitcherPageList` 1 `ConfigLayout`;\

mapkey(continued) ~ Select `ribbon_options_dialog` `ConfigLayout.ImportExportBtn`;\

mapkey(continued) ~ Activate `ribbon_options_dialog` `ConfigLayout.Open`;\

mapkey(continued) ~ Activate `file_open` `Current Dir`;\

mapkey(continued) ~ Activate `file_open` `Ph_list.Filelist` 1 `sw.pro`;\

mapkey(continued) ~ Activate `ribbon_options_dialog` `OkPshBtn`;\

mapkey(continued) ~ FocusIn `UITools Msg Dialog Future` `no`;\

mapkey(continued) ~ Activate `UITools Msg Dialog Future` `no`;\

mapkey(continued) ~ @SYSTEMDel sw.pro;

mapkey cd ~ Select `dwg_create` `rad_format`1  `1`;\

mapkey(continued) ~ Activate `dwg_create` `psh_browse`;\

mapkey(continued) ~ Trail `UI Desktop` `UI Desktop` `DLG_PREVIEW_POST` `file_open`;\

mapkey(continued) ~ Trail `UI Desktop` `UI Desktop` `PREVIEW_POPUP_TIMER` \

mapkey(continued) `file_open:Ph_list.Filelist:<NULL>`;~ Input `file_open` `Inputname` `c`;\

mapkey(continued) ~ Input `file_open` `Inputname` `c:`;~ Input `file_open` `Inputname` `c:\\`;\

mapkey(continued) ~ Update `file_open` `Inputname` `c:\\`;~ Activate `file_open` `Inputname`;\

mapkey(continued) ~ Input `file_open` `Inputname` `b`;\

mapkey(continued) ~ Update `file_open` `Inputname` `b`;\

mapkey(continued) ~ Activate `file_open` `Inputname`;~ Input `file_open` `Inputname` `d`;\

mapkey(continued) ~ Update `file_open` `Inputname` `d`;\

mapkey(continued) ~ Activate `file_open` `Inputname`;~ Activate `dwg_create` `psh_ok`;\

mapkey(continued) ~ Command `ProCmdViewRefit` ;~ Command `ProCmdViewRefit` `OK`;

mapkey swc ~ Command `ProCmdViewRefit` ;~ Command `ProCmdDwgRegenModel`

mapkey(continued) ~ Command `ProCmdDwgRegenModel` ;~ Command `ProCmdModelSave`

mapkey(continued) ~ Activate `file_saveas` `Cancel`;~ Close `main_dlg_cur` `appl_casc`;\

mapkey(continued) ~ Activate `main_dlg_cur` `page_Layout_control_btn` 1;\

mapkey(continued) ~ Close `main_dlg_cur` `appl_casc`;~ Command `ProCmdSessionChangeDir`

mapkey(continued) ~ Trail `UI Desktop` `UI Desktop` `DLG_PREVIEW_POST` `file_open`;\

mapkey(continued) ~ Command `ProFileSelPushOpen@context_dlg_open_cmd`

mapkey(continued) ~ Command `ProCmdModelSave` ;~ Activate `file_saveas` `OK`;\

mapkey(continued) ~ Command `ProCmdWinCloseGroup`

mapkey(continued) ~ Resize `main_dlg_cur` `main_dlg_cur` 0;\

mapkey(continued) ~ Trail `UI Desktop` `UI Desktop` `PREVIEW_POPUP_TIMER` \

mapkey(continued) `main_dlg_w1:PHTLeft.AssyTree:<NULL>`;~ Command `ProCmdWinCloseGroup`

mapkey(continued) ~ Command `ProCmdModelEraseNotDisp` ;~ Activate `file_erase_nd` `ok_pb`;

Let me know if I am missing anything

One more request, during the drw mapkey is it possible to get the a suffix 02 added in the drawing name.

1-Visitor
April 18, 2016

Hi Jose,

I tried the file and works great !!!.

From the Trailmaker how would I open a solidworks file and save it to prt.

I tried the below sequence. No conversion happened.

Can you provide me a solution.

~ Command `ProCmdModelOpen`

~ Trail `UI Desktop` `UI Desktop` `DLG_PREVIEW_POST` `file_open`

~ Open `file_open` `Type`

~ Close `file_open` `Type`

~ Select `file_open` `Type` 1 `db_886`

~ Command `ProFileSelPushOpen@context_dlg_open_cmd`

~ Activate `impt_new_model` `PushButton3`

~ Command `ProCmdModelSaveAs`

~ Update `file_saveas` `opt_EMBED_BROWSER_TB_SAB_LAYOUT` `C:\\`

~ Activate `file_saveas` `opt_EMBED_BROWSER_TB_SAB_LAYOUT`

~ Select `file_saveas` `type_option` 1 `db_539`

~ Activate `file_saveas` `OK`

~ Activate `intf_export` `solids` 1

~ Activate `intf_export` `OkPushBtn`

1-Visitor
October 1, 2016

the downloads link has been restricted? can you please check

https://www.dropbox.com/s/nprv7wx6u2iog2n/TrailMaker.zip?dl=0 

12-Amethyst
October 2, 2016

Something with Dropbox...

I attached the file bellow.

12-Amethyst
February 28, 2017

Well, due to this problem: Debug dump

Trailmaker is not working in newer versions of Creo.