Hi, is there a way to open explorer already in the current Powermill project?
Macro place to make it clear what I mean.
thanks
Solved! Go to Solution.
is this what you're looking for:
STRING fld = project_pathname(0) + "/"
OLE FILEACTION "OPEN" $fld
Hi, I was interested in opening this Powermill window in the current project and not explorer Windows.
Thanks
oh, i see what you mean
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 "
are you trying to import something else into your current session? what's the end goal?
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
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
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.
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?
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
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
}
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.
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
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, '/', '\')
.
.
}
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.
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
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.