Macro: Hole Diam - Create Tools by Diam - Create Drill Toolpath for every Diam

Macro: Hole Diam - Create Tools by Diam - Create Drill Toolpath for every Diam

Anonymous
Not applicable
4,728 Views
34 Replies
Message 1 of 35

Macro: Hole Diam - Create Tools by Diam - Create Drill Toolpath for every Diam

Anonymous
Not applicable

Hi all !

 

Im trying make macro for drilling, but i have not success.

 

What i need:

1) Create Fsets for Holes for 3-axis drilling (and, may be - group it by dia)

2) Take diameters of holes and make drills that correspond to every diam (hole 8mm = Drill with diameter 8.0 mm and name Drill 8.0 etc)

3) Make toolpaths for every drill with name of the drill

4) Insert cutting feeds, depends from diam (for example, if diam 4-6 = feeds1, if diam 8-10 = feeds2 etc.  )

 

the first point i can make

but for 2-3-4 i have not skill

can anyone some help for me ?

 

Thanks

 

PS: im using PM2016

0 Likes
4,729 Views
34 Replies
Replies (34)
Message 2 of 35

rafael.sansao
Advisor
Advisor

Want only that? Smiley Frustrated
Why do not you post what you have so far so we can help you?

 

The goal of the forum is to help those who want to learn and not provide ready solutions ...

Rafael Sansão

OptiNC - www.optinc.tech

EESignature

Message 3 of 35

Anonymous
Not applicable

im really dont know how to take hole diameter and insert it to drill tool diameter

 

help me at least with this - and then i can create some variant of working macro

0 Likes
Message 4 of 35

TK.421
Advisor
Advisor

it sounds like what you want is to use a drilling method. if these are hole sizes that you regularly drill a drilling method would be faster than a macro once you set it up with your tools and hole sizes.  The guys on the fixturing side of our business use only those. They drill, tap, ream, countersink everything from 4-40 holes to 1" holes. it takes a little work on the front end to set up but then it's done.

 

you could create all your drills, taps, whatever and save those to a template file and then create a macro to make your feature set, load your cutter template and run the drilling method. That would be the best way, in my opinion.

 

like @rafael.sansao said, this isnt a quick macro to bang out...

 


the numbers never lie
Message 5 of 35

Anonymous
Not applicable
Accepted solution
Message 6 of 35

NanchenO
Collaborator
Collaborator

At least point 4: You can load RPMs and feeds from the tools if they are correctly defined.

 

For the rest: good luck, since it's a lot of work to have it running without any errors, even with drilling methods.

 

Olivier

Message 7 of 35

5axes
Advisor
Advisor

TK.421 Wrote :

 

 The guys on the fixturing side of our business use only those. They drill, tap, ream, countersink everything from 4-40 holes to 1" holes. it takes a little work on the front end to set up but then it's done.

 


I'm still struggling with these Drilling methods . Are they using  :

  1. One global drilling method
  2. One drilling method by feature type ( M6,M8 ...)
  3. One drilling method by feature type ( M6,M8 ...) and by material


Any advice on the best practice or feedback will be welcome on How to setup these drilling methods.

 

My choice for the moment is to use one drilling method by feature type and by material  but even with this level of detail it's hard to get a method that works 100%. And each revision is a pretty painful job.

 

Message 8 of 35

Anonymous
Not applicable

Mateusz - thanks for help ! Your macro is best for me )

 

Im make some changes for me (im not need folders for use it and translate polish to english) and now simple macro is work.

First 3 points are ready.

 

Now i need to insert feeds, depends from drill diams.

Any suggestions ?

 

 

<<it sounds like what you want is to use a drilling method.>>

hmm, thanks for suggestion - im really dont pay attention to it.

May be im try it some later...

 

0 Likes
Message 9 of 35

Anonymous
Not applicable

Help me please a little...

 

 

1) How can i use {featureset}.Compound ?

 

when i type something like   -   BOOL  {featureset}.Compound = FALSE

PM always say the error

 

2) How can i delete upper part of compound holes and make lower part of hole longer on the upper hole length ?

 

 

thanks.

0 Likes
Message 10 of 35

5axes
Advisor
Advisor

Hole Feature Sets - PowerMill Parameter Reference  Compound is read only.. You cannot change its value just read it : 

 

print =$entity('featureset','').Compound

 

 

Message 11 of 35

Anonymous
Not applicable

Thanks 5axes

 

May be anyone know about second question ?

0 Likes
Message 12 of 35

Anonymous
Not applicable

I know, and I can try to prepare it for you, but I need a little time.

 

 

Mateusz

Message 13 of 35

Anonymous
Not applicable

Thanks Mateusz !

0 Likes
Message 14 of 35

Anonymous
Not applicable
Accepted solution

It will delete all chamfers and deepening, leaving only one part of hole with the lower dimension (works on max. 1 deepening):

 


INT subNum = 0 INT comp = 0 DEACTIVATE FEATURESET FOREACH fsets IN folder ('FeatureSet') { FOREACH feat IN components(fsets) { IF feat.type == 'hole' { IF feat.num_items > 1 { FOREACH sub IN components(feat) { IF ((sub.Draft < 89) AND (sub.Draft > 1)) OR ((sub.Draft > -89) AND (sub.Draft < -1)) { INT subNum2 = $subNum + 1 REAL depthPrevComp = 0 ACTIVATE FEATURESET $fsets.name EDIT FEATURESET $fsets SELECT $feat.name IF subNum > 0 { $depthPrevComp = abs(components(components(entity('Featureset', '$fsets.name'))[$comp])[$subNum-1].Depth) } IF subNum2 < feat.num_items { REAL depth = abs(components(components(entity('Featureset', '$fsets.name'))[$comp])[$subNum2].Depth) - $depthPrevComp EDIT FEATURESET ; FEATURE SELECTION $subNum2 EDIT FEATURESET ; FEATURE SELECTED COMPONENT SELECTED DEPTH $depth } IF subNum2 == feat.num_items { $subNum2 = $subNum2 - $subNum REAL depth = 0 IF feat.num_items > 2 { $depth = abs(components(components(entity('Featureset', '$fsets.name'))[$comp])[$subNum].Depth) - abs(components(components(entity('Featureset', '$fsets.name'))[$comp])[0].Depth) } ELSE { $subNum2 = $subNum2 - 1 $depth = abs(components(components(entity('Featureset', '$fsets.name'))[$comp])[$subNum].Depth) } EDIT FEATURESET ; FEATURE SELECTION $subNum2 EDIT FEATURESET ; FEATURE SELECTED COMPONENT SELECTED DEPTH $depth } EDIT FEATURESET ; FEATURE SELECTION $subNum EDIT FEATURESET ; FEATURE DELETE EDIT FEATURESET $fsets.name DESELECT $feat.name $subNum = $subNum - 1 } $subNum = $subNum + 1 } $subNum = 0 } } IF feat.num_items > 1 { ACTIVATE FEATURESET $fsets.name REAL depth = abs(components(components(entity('Featureset', '$fsets.name'))[$comp])[1].Depth) EDIT FEATURESET $fsets SELECT $feat.name EDIT FEATURESET ; FEATURE SELECTION '1' EDIT FEATURESET ; FEATURE SELECTED COMPONENT SELECTED DEPTH $depth EDIT FEATURESET ; FEATURE SELECTION '0' EDIT FEATURESET ; FEATURE DELETE EDIT FEATURESET $fsets.name DESELECT $feat.name } $comp = $comp + 1 } $comp = 0 }

 

I've an idea how to do it to works on more deepening levels, but it will be completely different macro, and now i don't have time to write and check it.

 

 

 

Mateusz

Message 15 of 35

Anonymous
Not applicable

Many thanks Mateusz !

 

Sometimes im work with plates withs compound holes

and i need to drill the lower holes and cut the upper big diams

 

This macro - exactly what i need !


@Anonymous wrote:
........................................

I've an idea how to do it to works on more deepening levels, but it will be completely different macro, and now i don't have time to write and check it.

 

Mateusz


Im not need more complex macro

 

Thanks again !

 

 

PS: i think this macro can be useful not only for me )

btw - this is a 5th macro that i (can try) insert in one macro for drilling

 

 

 

0 Likes
Message 16 of 35

Anonymous
Not applicable

Hi all !

 

I need else some help.

I want for fitment holes decrease Diameter by 1 mm

This part of macro looks like:

 

   ENTITY LIST $Selected_Featuresets = INPUT ENTITY MULTIPLE FEATURESET "Select Featuresets"
   FOREACH $fs in $Selected_Featuresets {
    ACTIVATE FEATURESET $fs.Name
    EDIT FEATURESET ; SELECT ALL
    EDIT FEATURESET ; FEATURE SELECTED COMPONENT SELECTED UPPERDIA "6,0-1"
    EDIT FEATURESET ; FEATURE SELECTED APPLYAXIS
   }

 

How can i set UPPERDIA as variable ?

 

Thanks

0 Likes
Message 17 of 35

Anonymous
Not applicable

Ok, im already found how to do this.

 

 

And last question: How i can use DepthType of holes (through, blind) for create same drill operations ?

0 Likes
Message 18 of 35

Anonymous
Not applicable

Hi !

 

My macro almost ready.

I need the last - define the string variable and insert it.

But i cant do it.

 

Can anyone help ?

Thanks.

BOOL option = FALSE
$option = QUERY "Drill from Block UP?"
	IF $option {
		STRING Top = "BLOCK"
	}    ELSE    {
		STRING Top = "HOLE"
	}


IMPORT TEMPLATE ENTITY TOOLPATH "Drilling/Drilling.ptf"
EDIT DRILL TYPE DEEP_DRILL
EDIT DRILL TOP $Top
EDIT DRILL DEPTH HOLE
EDIT DRILL DWELLTIME "0"
EDIT PAR 'AxialDepthOfCut.UserDefined' '1' EDIT DRILL PECK_DEPTH "2"
EDIT TOOLPATH ; CALCULATE
EDIT TOOLPATH SAFEAREA RESET
RESET TOOLPATH RAPID
0 Likes
Message 19 of 35

rafael.sansao
Advisor
Advisor

Try this:

BOOL option = FALSE
$option = QUERY "Drill from Block UP?"

IMPORT TEMPLATE ENTITY TOOLPATH "Drilling/Drilling.ptf"
EDIT DRILL TYPE DEEP_DRILL
IF $option {
	EDIT DRILL TOP "BLOCK"
} ELSE {
	EDIT DRILL TOP "HOLE"
}
EDIT DRILL DEPTH HOLE
EDIT DRILL DWELLTIME "0"
EDIT PAR 'AxialDepthOfCut.UserDefined' '1' EDIT DRILL PECK_DEPTH "2"
EDIT TOOLPATH ; CALCULATE
EDIT TOOLPATH SAFEAREA RESET
RESET TOOLPATH RAPID

Rafael Sansão

OptiNC - www.optinc.tech

EESignature

Message 20 of 35

Anonymous
Not applicable

Thanks, it works. (but without " ")

 

But i need the global variable.

If there was 10 different diameters of holes - 10 times answer on same question will be boring.

0 Likes