Help With Featureset Macro

Help With Featureset Macro

danmic7JH66
Advocate Advocate
1,282 Views
2 Replies
Message 1 of 3

Help With Featureset Macro

danmic7JH66
Advocate
Advocate

I'm trying to improve programing time at my company through getting the guys onboard with macro programming as much as possible.  I'm in charge of all the data prep (install fcs, coloring the model etc...) and macros.  We have a 5axis machine that I would like to macro out drilling holes based on color.  I've got it down to do 5axis toolpaths without issue, the problem is because of travel issues we frequently have to drill holes 3 axis instead.  The problem I'm running into is naming the featuresets properly.  For example if I'm drilling a part with dowel holes on both ends it will create a featureset for both ends but it only names one of them "dowels", the other will remain named "1" or whatever number is assigned.  How can I get the macro to output the name "dowels" for one featureset and "dowels_1" for the second. This is what my macro looks like to make the featureset.

 

// DOWEL BLIND FEATURESET

 

EDIT SELECTION MODEL DELETE

EDIT SELECTION SMART NO FORM MODELSELECT

EDIT SELECTION MODEL FILTER "255, 128, 0"

EDIT SELECTION MODEL APPLY

FORM CANCEL MODELSELECT

EDIT FEATURECREATE TYPE HOLE EDIT FEATURECREATE CIRCULAR ON EDIT FEATURECREATE FILTER HOLES EDIT FEATURECREATE TOPDEFINE ABSOLUTE EDIT FEATURECREATE BOTTOMDEFINE ABSOLUTE FORM CANCEL FEATURE FORM CREATEHOLE

EDIT FEATURECREATE HOLES FIXED ON

EDIT FEATURECREATE HOLES DIRECTION BOTH

EDIT FEATURECREATE CREATEHOLES

RENAME FEATURESET ; "DOWELS BLIND"

FORM CANCEL CREATEHOLE

UNDRAW FEATURESET ALL

DEACTIVATE FEATURESET

 

Here's what it looks like to run the drilling method

// CHOOSE MATERIAL

 

STRING ARRAY MATERIAL[] = {"ALUMINUM", "STEEL", "DELRIN"}

INT $STOCK = INPUT CHOICE MATERIAL "CHOOSE A MATERIAL TO DRILL"

 

IF $STOCK == 0 {

// DRILLS TAPPED BLIND HOLES

 

DEACTIVATE FEATURESET

ACTIVATE Featureset "TAPPED BLIND"

IMPORT TEMPLATE ENTITY TOOLPATH TMPLTSELECTORGUI ""

EDIT METHOD APPLY

DELETE TOOLPATH "1"

DEACTIVATE FEATURESET

 

 

Any help would be appreciated, bigly.

 

 

 

 

0 Likes
Accepted solutions (1)
1,283 Views
2 Replies
Replies (2)
Message 2 of 3

Anonymous
Not applicable
Accepted solution

Simple macro for new entity name:

 

FUNCTION NewName(STRING EntityType,OUTPUT STRING NewName)  {
IF NOT entity_exists($EntityType,$NewName) {
   RETURN
}
$NewName=new_entity_name($EntityType,$NewName)
}

 

Use your case:

 

STRING FeatName="DOWELS BLIND"
CALL NewName('Featureset',$FeatName)

 

RENAME FEATURESET ; $FeatName

 

0 Likes
Message 3 of 3

danmic7JH66
Advocate
Advocate
Works beautifully thank you!



Have a Great Day,



Dan Mickle

CNC Programmer






ACTIVE INDUSTRIAL SOLUTIONS


2391977,-82.9681798,17z/data=!3m1!4b1!4m2!3m1!1s0x883b296c835a99af:0xb3a2aa4
7972042dc?hl=en> 2155 North Talbot Rd. Windsor, Ontario

e.
danmic@activeindustrialsolutions.com

w.
www.activeindustrialsolutions.com



0 Likes