extract toolpath folder in project folder

extract toolpath folder in project folder

karan30782
Advocate Advocate
785 Views
5 Replies
Message 1 of 6

extract toolpath folder in project folder

karan30782
Advocate
Advocate

HI, There !

I'm exploring through a macro that must create folders in "Nc programs" explorer.
Folders are already in "Toolpath" explorer.

And these "Nc programs" folder must be created in Project > Ncprograms.


I'm working on this code below ...........

// macro start ===========

 

 

STRING $dirpath = project_pathname(0) + "/ncprograms/"
MKDIR $dirpath
EXPLORER SELECT TOOLPATH ROOT


STRING LIST TPFOLDERS = get_folders('TOOLPATH')
FOREACH tp IN TPFOLDERS {

CREATE FOLDER project_pathname(0) + '\ncprograms\' $tp


}

 

 

can someone add their idea, where I'm wrong.

 

11.JPG

 

Thank you !

0 Likes
786 Views
5 Replies
Replies (5)
Message 2 of 6

kmarkopouliotis
Advocate
Advocate

Hi,

TRY THESE MACROS. HOPE WILL HELP.

 

THANK YOU.

Message 3 of 6

karan30782
Advocate
Advocate

Thanks for replying,

With your code It extract folders from "toolpath" to "nc program".

That's fabulous.

But, even after so many attempt I'm unable to create those folder in project > ncprogram (folder)

 

Thanks again !

0 Likes
Message 4 of 6

kmarkopouliotis
Advocate
Advocate

Hello,

you have to save your project and run the "02_folder_matching.mac". Afterward when you write your NCPROGRAM it will be written in the same position (tree) in ncprogram file.

Message 5 of 6

karan30782
Advocate
Advocate

Hi ! @kmarkopouliotis 

 

I just followed th steps and it worked somewhat.

I still didn't got final solution and yet working on it.

 

But, anyway your code helped me alot.

 

Thank you !

0 Likes
Message 6 of 6

kl1445
Enthusiast
Enthusiast

Hi

I had the same problem before, but I have solved it, I hope you can use it

 

STRING $dirpath = project_pathname(0) +"/ncprogram"+"/"
MKDIR $dirpath
EXPLORER SELECT TOOLPATH ROOT

 


STRING $path = project_pathname(0) + "/ncprogram"
MKDIR $path


EDIT NCPROGRAM ALL FOLDER PROJSELECTOR $path

 

NCGLOBAL APPLY
NCGLOBAL ACCEPT

 

 

0 Likes