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

setting working directory with mapkeys

mdenicola
Amethyst

setting working directory with mapkeys

Hi

 

I would like to speed up as much as possible the working directory setting.

Our final working directory is often a number that can vary from 1 to 9999

I would like to set up a procedure started with a mapkey (or, if it makes sense, any other way) asking this item code number and setting the working directory. The directory before this item code number can be the same (if the customer is the same) or can change (if the Customer is another one)

 

Let's make an example:

 

N:\ProE_Docs\Forgings\CustomerName1\10
N:\ProE_Docs\Forgings\CustomerName1\123
N:\ProE_Docs\Forgings\CustomerName2\9999


So, this path can change on the last two directories.
Is that possible to read a database where every item code number  is assigned to a CustomerName, in order to know how to set the right path for that item?
In this way, when I call the macro, an input ask me the item number, read on the database to know the CustomerName assigned to that item code number and than the working directory can be set corectly.

 

I hope to have explained it in a clear way.

 

Thanks

 

25 REPLIES 25

Re: setting working directory with mapkeys


@mdenicola wrote:

Hi

 

I would like to speed up as much as possible the working directory setting.

Our final working directory is often a number that can vary from 1 to 9999

I would like to set up a procedure started with a mapkey (or, if it makes sense, any other way) asking this item code number and setting the working directory. The directory before this item code number can be the same (if the customer is the same) or can change (if the Customer is another one)

 

Let's make an example:

 

N:\ProE_Docs\Forgings\CustomerName1\10
N:\ProE_Docs\Forgings\CustomerName1\123
N:\ProE_Docs\Forgings\CustomerName2\9999


So, this path can change on the last two directories.
Is that possible to read a database where every item code number  is assigned to a CustomerName, in order to know how to set the right path for that item?
In this way, when I call the macro, an input ask me the item number, read on the database to know the CustomerName assigned to that item code number and than the working directory can be set corectly.

 

I hope to have explained it in a clear way.

 

Thanks

 


Hi,

I am almost sure that Creo OOTB functionality does not enable you to create requested macro.

I think that you can use AutoIt to develop small application that will fulfill your needs. You can launch such application (exe file) using Creo mapkey.

  • AutoIt can read text file containing your "database"
  • AutoIt can display the contents of your "database" in dialog box
  • AutoIt enables you to select specific "working directory" in dialog box
  • AutoIt is able to sent commands to Creo for setting selected working directory (if you press Alt key, you can see letters that enables you to control Creo using keyboard)

 


Martin Hanák

Re: setting working directory with mapkeys

Hi Martin

 

thanks for your reply.

 

That's very interesting about this Autolt. 

The problem is  that I've no idea how to do that, lol

 

Maybe you could give me an help?

 

Thanks a lot

 

Marco

 

Re: setting working directory with mapkeys


@mdenicola wrote:

Hi Martin

 

thanks for your reply.

 

That's very interesting about this Autolt. 

The problem is  that I've no idea how to do that, lol

 

Maybe you could give me an help?

 

Thanks a lot

 

Marco

 


Hi,

I can create AutoIt script for you, if you are not in a hurry. I guess I need one week to prepare the script.

 

Suggestion no.1 - workdir_database.txt (in this file you will be able to define working directories.

Customer=N:\ProE_Docs\Forgings\CustomerName1
10
123
Customer=N:\ProE_Docs\Forgings\CustomerName2
9999

 

Suggestion no.2 - AutoIt script functionality

  • step 1 - script displays customer list, user selects one customer name and clicks OK
  • step 2 - script displays directory list for selected customer, user selects one directory and clicks OK
  • step 3 - script sets selected working directory

 


Martin Hanák

Re: setting working directory with mapkeys

Hi Martin

 

thanks a lot for your help.

I am not in a hurry at all. 

 

What I was thinking to be useful and fast was that when the user have to set the working directory for that item , even without know where that directory is, write something like a mapkey called  'wd' + 'item number' :

 

wdxxxx

 

And that's all , the working directory has been set.

 

Is that possible such level of automation?

 

Thanks

 

Marco

 

 

Re: setting working directory with mapkeys

Hi,

in select_working_dir_2020-06-26.zip you can find first version of setting working directory tool.

Please read select_working_dir_INFO.doc and ask questions if you need some explanation.

I tested the tool in CR4 M110.


Martin Hanák

Re: setting working directory with mapkeys

Hi Martin

 

it works great! 

Is it possible to change the path C:\PTC\autolt  in order to have not a local but a path on the network where different users can  access?

 

A good one could be:

 

N.\CADCAM_DOCS\ProE_Disegni\autolt

 

How can I learn how you did this program?

 

Thanks

 

Marco

 

Re: setting working directory with mapkeys


@mdenicola wrote:

Hi Martin

 

it works great! 

Is it possible to change the path C:\PTC\autolt  in order to have not a local but a path on the network where different users can  access?

 

A good one could be:

 

N.\CADCAM_DOCS\ProE_Disegni\autolt

 

How can I learn how you did this program?

 

Thanks

 

Marco

 


Hi,

you can place the tool in any directory. The only change you have to do is modification of mapkey definition.

 

You have to modify my definition

mapkey wd @SYSTEMstart C:\\PTC\\autoit\\select_working_dir.exe;

into your definition

mapkey wd @SYSTEMstart N:\\CADCAM_DOCS\\ProE_Disegni\\autolt\\select_working_dir.exe;

Notice doubled backslash characters in the path

 

To understand the tool, you have to:

 


Martin Hanák

Re: setting working directory with mapkeys

Hi

 

one more help, if is possible:

 

with Creo 4.0 and higher version it works.

 

But I also use Creo Elements Pro 5.0. I tried but it's not working.

Is possible to make a version working for this old release?

 

Thanks 

 

Marco

Re: setting working directory with mapkeys

 Here one possible sample:

Re: setting working directory with mapkeys

Hi RPN

 

that's nice! Thanks.

 

Is that possible a faster way :

 

I type wd+id item number  , for example:

 

wd1500

 

and the working directory is set   to N:\\........\..........\.......\CustomerName\1500\

 

I mean the script can read a database or a text file how Martin has shown  and know which CustomerName to set depending on the item number 

 

Is that possible?

 

Thanks

Re: setting working directory with mapkeys

Sure, I work frequently with SQLite, text as well, or you parse on start and use dynamic arrays. It’s written in Tcl, I would say 200 lines of code for the GUI, it is a „hypertext“ text widget, to allow scrolling, 3 commands for creo, connect, message and change dir. And fur sure a“dirty hack“ just to archive the Target.

Mapkeys are not used, just „ps_cd <TargetDir>“. This not that complicated.

„Hunger comes with eating„ 😅 That’s what I believe in your case, e.g. clean Creo Session, Save modified in current session, load from folder, config customer env, to name a few. 

Re: setting working directory with mapkeys

Hi

 

Unfortunately to me this sounds too complicate . If you would like to develop this solution I would be very grateful.


Thank You

 

Marco

Re: setting working directory with mapkeys


@mdenicola wrote:

Hi

 

one more help, if is possible:

 

with Creo 4.0 and higher version it works.

 

But I also use Creo Elements Pro 5.0. I tried but it's not working.

Is possible to make a version working for this old release?

 

Thanks 

 

Marco


Hi,

I can slightly modify tool version released on 26-Jun-2020 to enable you to use the tool with Creo Elements Pro 5.0, too. Please wait 🙂


Martin Hanák

Re: setting working directory with mapkeys


@MartinHanak wrote:

@mdenicola wrote:

Hi

 

one more help, if is possible:

 

with Creo 4.0 and higher version it works.

 

But I also use Creo Elements Pro 5.0. I tried but it's not working.

Is possible to make a version working for this old release?

 

Thanks 

 

Marco


Hi,

I can slightly modify tool version released on 26-Jun-2020 to enable you to use the tool with Creo Elements Pro 5.0, too. Please wait 🙂


Hi,

in select_working_dir_2020-06-29.zip you can find modified version.

Please read select_working_dir_config.txt__INFO.txt file.

The tool can be "installed" twice ... you can call first instance from Creo 4.0 and second one from Creo Elements/Pro 5.0.


Martin Hanák

Re: setting working directory with mapkeys

Hi Martin

 

The Creo Elements 5.0 version is not working.

It reads the select_working_dir_list.txt , I choose the customer name, than the item number, but after that 

I get the error as shown in the picture.

 

The Creo 4 version it works.

 

I made two separate directories where the only difference is the file 'select_working_dir_config.txt' modified for the two versions.

 

Another thing:

In the select_working_dir_INFO.doc 

 

I dont understand what you mean with:

 

line no.2 ... keyboard shortcut for opening Select Working Directory dialog box

 

Thanks a lot for your help

 

Marco

Re: setting working directory with mapkeys


@mdenicola wrote:

Hi Martin

 

The Creo Elements 5.0 version is not working.

It reads the select_working_dir_list.txt , I choose the customer name, than the item number, but after that 

I get the error as shown in the picture.

 

The Creo 4 version it works.

 

I made two separate directories where the only difference is the file 'select_working_dir_config.txt' modified for the two versions.

 

Another thing:

In the select_working_dir_INFO.doc 

 

I dont understand what you mean with:

 

line no.2 ... keyboard shortcut for opening Select Working Directory dialog box

 

Thanks a lot for your help

 

Marco


Hi,

the problem may be caused by using the Italian version of Creo Elements/Pro 5.0.

I will send you additional information in next Reply.


Martin Hanák

Re: setting working directory with mapkeys


@MartinHanak wrote:

@mdenicola wrote:

Hi Martin

 

The Creo Elements 5.0 version is not working.

It reads the select_working_dir_list.txt , I choose the customer name, than the item number, but after that 

I get the error as shown in the picture.

 

The Creo 4 version it works.

 

I made two separate directories where the only difference is the file 'select_working_dir_config.txt' modified for the two versions.

 

Another thing:

In the select_working_dir_INFO.doc 

 

I dont understand what you mean with:

 

line no.2 ... keyboard shortcut for opening Select Working Directory dialog box

 

Thanks a lot for your help

 

Marco


Hi,

the problem may be caused by using the Italian version of Creo Elements/Pro 5.0.

I will send you additional information in next Reply.


Hi,

I realized that I forgot to update select_working_dir_INFO.doc document.

Please read new select_working_dir_INFO_2020-06-29.doc document.

 


Martin Hanák

Re: setting working directory with mapkeys

Hi

 

so,  for WF5  the third line (the shortcut) of the select_working_directory.txt should be 'wl'  (see attached image)

 

But I noticed that, while in Creo4 after pressing ALT+f+m+w , the dialog window open automatically, on WF5, after ALT+f+l the dialog window is not open but is like in the picture attached. It opens only after pressing ENTER.

 

Thanks

Marco

 

 

Re: setting working directory with mapkeys


@mdenicola wrote:

Hi

 

so,  for WF5  the third line (the shortcut) of the select_working_directory.txt should be 'wl'  (see attached image)

 

But I noticed that, while in Creo4 after pressing ALT+f+m+w , the dialog window open automatically, on WF5, after ALT+f+l the dialog window is not open but is like in the picture attached. It opens only after pressing ENTER.

 

Thanks

Marco

 

 


Picture is missing.


Martin Hanák

Re: setting working directory with mapkeys

sorry.. here it is

 

 

Re: setting working directory with mapkeys


@mdenicola wrote:

sorry.. here it is

 

 


Maybe final question. Does the tool work in  Italian version of Creo Elements/Pro 5.0 ?


Martin Hanák

Re: setting working directory with mapkeys

no, it's not working.

Should I try to set WF5 in english language?

Re: setting working directory with mapkeys


@mdenicola wrote:

no, it's not working.

Should I try to set WF5 in english language?


Hi,

yes, please do it. I'll try Italian version.


Martin Hanák

Re: setting working directory with mapkeys


@MartinHanak wrote:

@mdenicola wrote:

no, it's not working.

Should I try to set WF5 in english language?


Hi,

yes, please do it. I'll try Italian version.


Hi,

I tested the tool with Creo Elements/Pro 5.0 M280 (ITALIAN).

The tool does not work because there are two commands using underlined character l (in File menu) - see picture.

WF5_italian_File_menu_duplicity.png

Solution ... put following 3 lines into select_working_dir_config.txt file.

(attivo)
Creo Elements/Pro
fl{ENTER}

 


Martin Hanák

Re: setting working directory with mapkeys

Hi Martin

 

now it works!

Amazing work, thank so much!

 

Marco

Announcements