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

Community Tip - Need help navigating or using the PTC Community? Contact the community team. X

Trailmaker 0.3

Jose_Costa
12-Amethyst

Trailmaker 0.3

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

48 REPLIES 48

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!

Humm.. conflicting mapkeys.

One character mapkeys are dangerous because of that.

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

Jose, this looks interesting....!

Can you please share how did you make this utility?

Thanks,

Sachin

Jose_Costa
12-Amethyst
(To:Sachin)

Not sure of what you want to know.

Creo creates trailfiles that record everything you do inside of creo. You can use them for recovery purposes in case of crash. But you can also use the code to control Creo.

For example, opening a file appears something like this in trail file:

~ Command `ProCmdModelOpen`

~ Update `file_open` `Inputname` `prt1.prt`

~ Activate `file_open` `Open`

So, if you replace "prt1.prt" with other partnames you will be able open multiple parts with one trailfile.

So, basicly, what do we need to create a custom file:

  • A list of files
  • A file with code from trails to execute inside of it
  • A tool to join this info into a single text file.

The list of files, I was too lazy to built a interface, so I capture the list from Creo fileopendialog. This was the easiest way for me, you can pre-filter by type (Prt, Drw,Asm, instances...), and then it opens the prefiltered list in notepad, where you can choose one by one. This list is saved in file_list.txt.

The code to execute inside of the files, you can create your own from trailfiles. I created some just for example, but everyone has different needs, so the best is to customize them. They are inside of C:\TrailMaker\trails.

Now I have a list of files and a file with code to run inside of each one. I can create a file mannualy with copy/paste but that´s gonna take a while.

So I create a script in Autoit that creates file run_trail.txa, and:

Writes header

Writes file open prt1

Writes trail code

Writes file open prt2

Writes trail code

Writes file open prt3

Writes trail code

..... until last file

Then all is needed is to run trailfile run_trail.txa.

You can create your customized trails and change the header, so I believe this is a interesting tool that can be used in all versions of Creo and Pro-e.

I hope I has been clear.

Jose

I changed the name of the mapkey to ">Play" to avoid conflicts with others.

It is working!!!!

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

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

Gucio
15-Moonstone
(To:Jose_Costa)

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

Krzysztof
Jose_Costa
12-Amethyst
(To:Gucio)

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

Jose_Costa
12-Amethyst
(To:Gucio)

Perhaps you can post an example?

Gucio
15-Moonstone
(To:Jose_Costa)

look at sample.

problem is that od drawing there is view that was created from flat combined view.

For any questions, please don’t hesitate to contact me.

Krzysztof
Jose_Costa
12-Amethyst
(To:Gucio)

No easy solution....

I tried 2 things:

1 - Open Generic, open family table dialog, select first instance, Edit->Copy instance to Generic, open drw, save as dx fwith instance name. Repeat for other instances, exit without save generic.

This way, replacing the generic for each one of the instances, you´ll get dxf´s of all intances. But you´ll never have the drw´s....

2 - Second try...This demands a specific script for it:

Create the drawing without the Flat view.

Create the drawings of the instances.

Open the drawing of the generic.

Now a script is needed to record the number of the last line in trail file.

Add flat view, and dimensions and etc.. Finish?

Script gets the code from trailfile, from recorded line until the end into memory.

Now, run this code inside of the drawing instances.

Done

Mapkeys don´t record screen selections, but trailfiles do, so everything you created in the first drw will be perfectly repeated in the instances drawings. Maybe there is a much simpler solution, but I can´t see it for now.

Jose

Forget it, I tried and it didn´t work...

It creates the flat view, but it can´t recreate the dimensions.

Jose,

You have done a great job - My problem is now the user is not allowed to use the C: to load the TrailMaker

He need to load it in something like C:\Prouse

Can the pathing be modified within the mapkey?

I tried C:\\Prouse\TrailMaker.... but for some reason, the file list comes up empty.

Do you have any suggestions?

Regards,

Charlie Price

Jose_Costa
12-Amethyst
(To:cprice)

Charles,

Has it worked?

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

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.

Gucio
15-Moonstone
(To:Jose_Costa)

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

Krzysztof
Jose_Costa
12-Amethyst
(To:Gucio)

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

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.

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

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

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

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.

Hi,

have you tried the file I provided earlier (prt2drw.txt)?

I think that's all you need to create automatic drawings.

Jose.

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`

the downloads link has been restricted? can you please check

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

Jose_Costa
12-Amethyst
(To:llokesh)

Something with Dropbox...

I attached the file bellow.

Well, due to this problem: Debug dump

Trailmaker is not working in newer versions of Creo.

Announcements
NEW Creo+ Topics: Real-time Collaboration


Top Tags