Skip to main content
14-Alexandrite
June 23, 2020
Question

setting working directory with mapkeys

  • June 23, 2020
  • 1 reply
  • 10076 views

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

 

1 reply

24-Ruby III
June 24, 2020

@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)

 

mdenicola14-AlexandriteAuthor
14-Alexandrite
June 24, 2020

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

 

24-Ruby III
June 24, 2020

@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