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

looking for a smarter solution to detect "Complex" Holder profil

5axes
Advisor

looking for a smarter solution to detect "Complex" Holder profil

5axes
Advisor
Advisor

Hello,

In one of my macros, I need to know if the holder is define with a complex shape or just with a basic stack of cylinder and cone. Complex definition comes most of the time when you define your holder via a DGK file or in some case when the tool is loaded via the Tool Library.

ComplexeProfil.jpg

I haven't find an easy way to detect such case. The solution I'm using right now is to try to save the holder as *.pmlth file.  Ie :

DIALOGS MESSAGE OFF
DIALOGS ERROR OFF

STRING FILEHolderPMLTH= $Tool.HolderName + ".pmlth"

EXPORT TOOLHOLDER ; $FILEHolderPMLTH YES IF NOT FILE_EXISTS($FILEHolderPMLTH) { MESSAGE WARN "BECAREFULL Complex Holder $FILEHolderPMLTH" } ELSE { DELETE FILE $FILEHolderPMLTH }

 

Do you have a solution to test this case , without this trick ?

0 Likes
Reply
Accepted solutions (1)
699 Views
4 Replies
Replies (4)

kukelyk
Advisor
Advisor

Try compare lower and upperdiameters all the holder elements. If it is a simple profil, then the lower diameter will be smaller or equal than upperdiameter in every case.

0 Likes

5axes
Advisor
Advisor

thanks for this Idea @kukelyk !

 

But it's not working. If you import the holder from a DGK file , the profile can be simple, respect the rules of a manualy created holder. But the holder cannot be edited  Smiley Sad

 

Complex1.jpg

0 Likes

kukelyk
Advisor
Advisor

Then try this:

DIALOGS ERROR OFF
DIALOGS MESSAGE OFF

FOREACH tl IN FOLDER('tool') {
STRING clone_name = new_entity_name('tool', $tl.name)
COPY TOOL $tl.name
REAL d0= $ENTITY('tool', $clone_name).holdersetvalues[0].upperdiameter
//$tool.holdersetvalues[0].upperdiameter = 1000
EDIT TOOL $clone_name HOLDER_COMPONENT 1
EDIT TOOL $clone_name HOLDER_COMPONENT UPPERDIA "1000"

IF $ENTITY('tool', $clone_name).holdersetvalues[0].upperdiameter != $ENTITY('tool', $tl.name).holdersetvalues[0].upperdiameter {
PRINT = $tl.name + "HOLDER NOT LOCKED"
} ELSE {
PRINT = $tl.name + "HOLDER LOCKED"
}
DELETE TOOL $clone_name
}
DIALOGS ERROR ON
DIALOGS MESSAGE ON

5axes
Advisor
Advisor
Accepted solution

Finaly, I haven't found a better solution than testing the export of the Holder as a PMLTH file. But in the same time this export is usefull, because in case of a locked holder, the PLMTH exported file can be used do replace the existing holder and by this way give back the possibility to modify the holder.LockedToolHolder.jpg

 Image : Locked Tool Holder definition after a DGK or Tool library creation

 

 

You will find hereafter the last tested release of my macro. The option $UpdateTool gives you the possibility to replace or not, the existing tool holder. The macro can be called from the tool.xml file with a command line :

<button command='MACRO "ExportPLMTH" "%s" 1' label="Export PLMTH and replace"  multiple_selection="allowed" />