Powermill macro for rest roughing

Anonymous

Powermill macro for rest roughing

Anonymous
Not applicable

Hi,

 

I have a macro to create a rest rough operation but I want it a little cleaner for the programmer to use.

 

When I run my macro it pauses and the user selects the reference operation to use for rest rough. (See image Rest Select current.png)

I would like to have my macro not show the full page but only as per image ( Rest Select.png )

 

 

---------------------------------------

STRING Toolpath = INPUT ENTITY TOOLPATH "Please select a Toolpath." 

Is it possible to use the code above to select the reference operation?

Or is there another way.

 

 

------------------------

And just for my education I would like to know if it is possible to automatically select the previous operation as the reference for rest roughing so the user doesn't need to select anything at all.

 

Thanks Anthony

 

0 Likes
Reply
1,538 Views
2 Replies
Replies (2)

5axes
Advisor
Advisor

You can use a code like the following example :

  // Define the research criteria (In this case will list every remachining toolpath or 3D roughing toolpath)
  STRING $expr = "AreaClearance.Rest.Active=='1' OR Strategy=='offset_area_clear'  OR  Strategy=='adaptive_area_clear' OR  Strategy=='raster_area_clear'"
  //  Ge the list of the toolpath
  STRING LIST $tp_list = extract(filter(folder('toolpath'), $expr), 'name')
  // Ask for a Choice
  INT $activate_tp = INPUT CHOICE $tp_list "Select the toolpath"
  // Activate the selected toolpath
  ACTIVATE TOOLPATH ${tp_list[activate_tp]}

In this example the toolpath List will contain only the 3D Roughing and Remaching toolpath.  

 

0 Likes

5axes
Advisor
Advisor

anthony.geremiaABQNF :

 And just for my education I would like to know if it is possible to automatically select the previous operation as the reference for rest roughing so the user doesn't need to select anything at all.  


If the "Previous operation" is the last toolpath or your list you can use something like :

 

 // Define the research criteria (In this case will list every remachining toolpath or 3D roughing toolpath)
  STRING $expr = "AreaClearance.Rest.Active=='1' OR Strategy=='offset_area_clear'  OR  Strategy=='adaptive_area_clear' OR  Strategy=='raster_area_clear'"
  //  Create the list of  toolpath
  STRING LIST $tp_list = extract(filter(folder('toolpath'), $expr), 'name')
  INT $ListSize = size($tp_list)-1
  // Get the last element of the list if element exists
  IF $ListSize >= 0 {
	STRING $LastTP=$tp_list[ListSize]
  }
0 Likes