Community
PowerMill Forum
Welcome to Autodesk’s PowerMill Forums. Share your knowledge, ask questions, and explore popular PowerMill topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Select File

29 REPLIES 29
SOLVED
Reply
Message 1 of 30
Anonymous
2526 Views, 29 Replies

Select File

Hi, is there a way to open explorer already in the current Powermill project?
Macro place to make it clear what I mean.
thanks

29 REPLIES 29
Message 2 of 30
TK.421
in reply to: Anonymous

is this what you're looking for:

STRING fld = project_pathname(0) + "/"
OLE FILEACTION "OPEN" $fld
--------------------------------------
Former Expert Elite Member (not enough participation in all their webinars and other "stuff", even though I beta test and regularly contribute to the betterment of the software and the PowerMill community as a whole)

the numbers never lie
Message 3 of 30
Anonymous
in reply to: TK.421

Hi, I was interested in opening this Powermill window in the current project and not explorer Windows.
Thanks

Message 4 of 30
TK.421
in reply to: Anonymous

oh, i see what you mean

--------------------------------------
Former Expert Elite Member (not enough participation in all their webinars and other "stuff", even though I beta test and regularly contribute to the betterment of the software and the PowerMill community as a whole)

the numbers never lie
Message 5 of 30
Anonymous
in reply to: TK.421

Sorry, I'm trying to open this Di Powermill window in the
current project folder:

 

 

STRING $folder = project_pathname(0) + "/"
MKDIR $folder
$folder=FILESELECT "Select File "

 

 

Message 6 of 30
TK.421
in reply to: Anonymous

are you trying to import something else into your current session? what's the end goal?

--------------------------------------
Former Expert Elite Member (not enough participation in all their webinars and other "stuff", even though I beta test and regularly contribute to the betterment of the software and the PowerMill community as a whole)

the numbers never lie
Message 7 of 30
Anonymous
in reply to: TK.421

You can import a model in .ddz format using the batc file
I wanted the explorer to open up already in the right director which would be that of the current project.
I attach complete macro to make you understand

Message 8 of 30
TK.421
in reply to: Anonymous

I dont know what a ddz file is. can you expand on that (for my own benefit).

 

As far as your macro goes, you can determine the file path of said file and then import it that way? you could do that without having to even interface with the file open dialog.

 

IMPORT MODEL $ddzModelPath

 

if you have multiple ddz files, you can put them in a pull down menu

 

 

--------------------------------------
Former Expert Elite Member (not enough participation in all their webinars and other "stuff", even though I beta test and regularly contribute to the betterment of the software and the PowerMill community as a whole)

the numbers never lie
Message 9 of 30
Anonymous
in reply to: TK.421

I state that I use many parasolid .x_t filesPowermill automatically converts them to .dgk. .ddz files are opened directly in Powermill because they are Powermill files, however they are 3 times smaller than a .dgk file. I've been using them for about a month and check if Powermill's plans are actually lighter. The macro converts a parasolid x_t to .ddz by opening it in Powermill via Manufacturig data excange. What I need is that when I run the macro, the explorer that opens is already in the current project folder and not in a random one.
Sorry English but I use a translator.
Thanks for your help.

Message 10 of 30
TK.421
in reply to: Anonymous

your english is good, dont worry. I'm slow to understand. I'm working at this now.

 

so you use ddz files because they are smaller? does powermill run faster with those?

--------------------------------------
Former Expert Elite Member (not enough participation in all their webinars and other "stuff", even though I beta test and regularly contribute to the betterment of the software and the PowerMill community as a whole)

the numbers never lie
Message 11 of 30
Anonymous
in reply to: TK.421

I'm checking it these days it seems so, but I'm waiting for a heavy project to have a confirmation.

Message 12 of 30
TK.421
in reply to: Anonymous

I know what you're asking now, but I dont know if theres a way to do it. I map the user paths to specific directories to help with shortcuts. One is a temp folder on my desktop where I keep all the projects I'm actively working on

Capture.PNG

--------------------------------------
Former Expert Elite Member (not enough participation in all their webinars and other "stuff", even though I beta test and regularly contribute to the betterment of the software and the PowerMill community as a whole)

the numbers never lie
Message 13 of 30
Anonymous
in reply to: Anonymous

Please test it:

INCLUDE OpenFileDialogMulti.INC
FUNCTION MAIN() {
// OpenFileDialogMulti() sample macro
// This macro calls the Powershell script, and
//  may need to be configured for the operating system to run properly.
//  Talk to your system administrator.
// TempDir: the macro working directory, require write access
   STRING TempDir='c:\Temp'
   STRING StartDir=project_pathname(0)
   IF $StartDir == '' {
      MESSAGE INFO 'Please save the project'
      RETURN
   }
   STRING Prompt='Please select .ddz files'
   STRING Extension='ddz'
// IsMulti: Allow multiple select
   BOOL IsMulti=TRUE
   STRING LIST Result={}
   CALL OpenFileDialogMulti($TempDir,$StartDir,$Prompt,$Extension,$IsMulti,$Result) 
   STRING Msg=''
   FOREACH F IN $Result {
      $Msg=$Msg+crlf+$F
   }
   $Msg='Selected files:'+$Msg
   MESSAGE INFO $Msg 
}

 

Message 14 of 30
Anonymous
in reply to: Anonymous

I'm sorry I can't get it to work.

However the macro I posted above works well converts .x_t to .ddz I just wanted to shorten the choice of the x_t file which is always inside the current Powermill project and I would like that when you open the file selection window it was already in the correct path and not on a random path.

 

Message 15 of 30
Anonymous
in reply to: Anonymous

I just realized that just press on the top left to enter the current project folder, see attachment.
Sorry if I made you waste time. Thanks

Message 16 of 30
Anonymous
in reply to: Anonymous

Oops!
The project_pathname(0) function gives this result: c:/akarmi/xxx
but Powershell is expecting c:\akarmi\xxx. Bug fixed:

FUNCTION OpenFileDialogMulti (….) {
.
.
$StartDir replace $ = ($ StartDir, '/', '\')
.
.
}

 

Message 17 of 30
Anonymous
in reply to: Anonymous

He gives me this message

Message 18 of 30
Anonymous
in reply to: Anonymous

a. Set the $TempDir variable to a valid directory (with write access)

b.  This macro calls the Powershell script, and   may need to be configured for the operating system to run properly.
  Talk to your system administrator.

Message 19 of 30
Anonymous
in reply to: Anonymous

Hi, I checked the TEMP folder for permissions it seems to me all ok look attached.
The powershell scripts I can run them see macro at post 7 but I always have the same error

Message 20 of 30
Anonymous
in reply to: Anonymous

Please run this macro.
If all goes well, you will find 4 files in the c:\temp directory:
tmp.bat,tmp.ps1,tmp.log,success.tmp.

Open Command Prompt window ( Start Menu Search -> cmd)
Type:
'c:'
'cd c:\temp'
'powershell -file tmp.ps1'
Take a snapshot of the result, and upload result files

 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report