Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.

Replace tool holder

j.lacrasse
Advocate

Replace tool holder

j.lacrasse
Advocate
Advocate

Hi all,

 

I have a program with all our tool and tool holder. I created a better representation of our holder and i'd like to replace the old one with the new one. My program contains 640 tools so no way i'm doing it manually.

 

I'd like some help to create that macro to replace holder named HOLDER 2po COURT by HOLDER 2po COURT - 2.320

 

All our tools are separate into folders.

 

2016-11-18_1154.png

 

Thx for the help,

J.Lacrasse

 

 

J.Lacrasse
0 Likes
Reply
Accepted solutions (1)
2,354 Views
21 Replies
Replies (21)

5axes
Advisor
Advisor

The question is :

 

Where are your new holders ?   because you need first to delete the existing holder and then integrate the new one , but the macro will be diffrent if your holder are define via a pmlth file , a dgk profile or already define in you tool database.

 

Best regards,

 

 

0 Likes

j.lacrasse
Advocate
Advocate

Hi @5axes

 

My tool holder are define in my tool database.

 

How do you erase a tool holder from the tool database? I can delete tool, stock material, but I don't see a X to delete holder.

 

Have a great week-end,

J.Lacrasse

J.Lacrasse
0 Likes

iamcdn79
Mentor
Mentor

Tool holder database is separate from tool database

 

Capture.PNG


Intel Core i9 13900KF CPU
128 GB Kingston Beast DDR4 SDRAM
PNY RTX A2000 6GB Video Card
WD 1 TB SSD Hard Drive
Windows 11 Pro

0 Likes

j.lacrasse
Advocate
Advocate

 2016-11-18_1418.png

 

This is what I see when I open the database. For Powermill 2017. Same for 2016

 

J.lacrasse

J.Lacrasse
0 Likes

iamcdn79
Mentor
Mentor

Tool holder database has a different icon from tool database.

 

Capture.PNG


Intel Core i9 13900KF CPU
128 GB Kingston Beast DDR4 SDRAM
PNY RTX A2000 6GB Video Card
WD 1 TB SSD Hard Drive
Windows 11 Pro

0 Likes

jonathan.artiss
Alumni
Alumni

Hi @j.lacrasse

 


@j.lacrasse wrote:

 2016-11-18_1418.png

 

This is what I see when I open the database. For Powermill 2017. Same for 2016

 

J.lacrasse


Have a look at the attached screen shot, similar to @iamcdn79 this is inside the active tool. Sometimes easier to access.

 

Cheers,

 


Jonathan Artiss
Application Engineer
Submitting & Viewing Support Requests | Web Support | Phone Support
0 Likes

5axes
Advisor
Advisor
Don't delete the toolholder in the database !!!!
I was talking about the toolholder in your PMILL till assembly definition.

Ans Just for a précision, even if you have two icône, tool and holder are store in the same database.
0 Likes

kukelyk
Advisor
Advisor

If I were You, i would write a simple macro:

 

import all tools

loop them, if tool.holdername equal  the old one, then change it to the new toolholder, and re-export to the tooldb.

 

I would run it in the night , it wiil be a long process.. (the tooldatabase operations take a bit amount of time..)

0 Likes

j.lacrasse
Advocate
Advocate

Hi @iamcdn79

 

You were right. I skipped your post, but this morning I took the time to read from top to bottom. And that's the way to delete it. I still need macro's guru help to write a macro to replace my holder.

 

Maybe as @kukelyk said or inside my program.

 

Thanks for the help

J.Lacrasse

J.Lacrasse
0 Likes

kukelyk
Advisor
Advisor
Accepted solution

 

 

// First import all the tools from the tooldb manually.
// note, if Your tooldb has different materials, You should import them with the relevant material
// Then run this:
FOREACH tl IN FOLDER('tool') {
	IF $tl.Holdername == "HOLDER 2po COURT" {
		ACTIVATE TOOL $tl.name
		EDIT TOOL ; HOLDER_CLEAR
		EDIT TOOL ; IMPORT_HOLDER "C:\2po COURT - 2.320.dgk" //dgk full path of the new holder

		TOOLDB EXPORT PROPOSE $tl.name
		TOOLDB EXPORT STOCK_MATERIAL SELECT $tl.StockMaterial
		TOOLDB EXPORT OPTIONS GEOMETRY ON
		TOOLDB EXPORT OPTIONS HOLDER ON
		TOOLDB EXPORT OPTIONS CUTTING_DATA ON
		TOOLDBEXPORT ACCEPT
	}
}

(not tested..)

0 Likes

Eskondedo
Advocate
Advocate

I am trying to accomplish the same thing except some of my tools are locked, because they are used more than once in the project.  I understand I will need to clone the tool and replace the holder but how can I determine if the tools locked because of the holder?  I tried using this macro and get the image shown below.  I tried the IF LOCKED (tool.length) and other (tool.___) commands but then it copies every tool and not just the locked ones.  Any help would be appreciated.Capture.PNG

0 Likes

kukelyk
Advisor
Advisor

You can get a list of all the tools used by any toolpaths:

(Note, that a boundary or stockmodel can also refer tools )

STRING LIST used_tools = extract(FOLDER('toolpath'),'Tool.Name')
INT k = remove_duplicates($used_tools)

And with the used tools:

IF member($used_tools, 'yourTool') {
   //copy 
} 
  //replace holder
0 Likes

Eskondedo
Advocate
Advocate

Thank you Kukelyk for the response, this has lead to down the right path.  What I cannot seem to find out is how to determine which of these tools are locked.  What I have found out is that if a tool has only been used by one toolpath the holder can be replaced after toolpath calculation. If a tool has been used in multiple toolpaths the tool holder is locked and cannot be replaced.  The following show what I am trying to explain.

Toolpath treeToolpath treeTool only used once, holder is not lockedTool only used once, holder is not lockedTool used more than once, holder is lockedTool used more than once, holder is locked

 

If I can determine what parameter is "locking" the holder I can then identify it within my macro and only copy these tools instead of every tool.

0 Likes

5axes
Advisor
Advisor

that's strange because in my case the holder is never locked even if the tool is used in different toolpaths or border ?

0 Likes

kukelyk
Advisor
Advisor

In my experience, when a tool is used by more toolpaths, where the collision check is done, pmill (at least pm2016) locks holder. 

5axes
Advisor
Advisor

Well looks like a bug or something not normal .  I'm agree with you @kukelyk  if you have several toolpaths using the same tool and you have made a collision check on several of them the tool definition is locked. 

BUT if you recalculate the profile of the holder then you get back the possibility to modify the Tool:

https://youtu.be/C1jIVAYW_VA 

kukelyk
Advisor
Advisor

I have never used profile calculation, as we have shrink, and narrow shrink holders. If the normal has no room, we choose the narrow one. If the narrow cannot fit, then we use EDM.

0 Likes

5axes
Advisor
Advisor

Even in this case it could be usefull to calculate the Holder Profile. If you add this option automaticaly then you directly get the collision status of your toolpaths at the end of the calculation . No need to use a macro to launch the toolpath verification or to test every toolpath one by one,  you can also get the collision status directly for every toolpath using the same tool .

EDIT TOOL ; PROFILE_INCLUDE_ALL
EDIT TOOL ; UPDATE_TOOLPATHS_PROFILE

 

 

 

0 Likes

bgundrum
Advocate
Advocate

I cannot figure out how to create a list of selected Tools. I am trying to apply the same holder to all tools on a list.

 

//  ADD A CHOSEN HOLDER TO SELECTED TOOLS
FORM TOOL ;
EDIT TOOL ; SEARCH_HOLDER
TOOLDB HOLDER QUERY SET NAME ""
TOOLDB HOLDER QUERY PRESET
TOOLDB HOLDER RESULTS_LIST SORT_COLUMN  0

//MACRO PAUSE

MESSAGE INFO "CHOOSE YOUR HOLDER"

ENTITY LIST $Tools = INPUT ENTITY MULTIPLE TOOLPATH "CHOOSE TOOLS TO ADD SELECTED HOLDER"

FOREACH ent in $Tools {

	ACTIVATE Tool $ent.name
	EDIT TOOL ; SEARCH_HOLDER
	TOOLDB HOLDER RESULTS_LIST APPLY_HOLDER SELECTED
}

 

0 Likes