Community
PowerMill Forum
Welcome to Autodesk’s PowerMill Forums. Share your knowledge, ask questions, and explore popular PowerMill topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Creating a hole feature set

3 REPLIES 3
Reply
Message 1 of 4
Anonymous
438 Views, 3 Replies

Creating a hole feature set

I have created a macro that creates hole feature set using the color from a model.

A problem with this macro is that if it doesn't encounter this color, it shows an error. These colors are pre-defined and hence I wish to use an if or a switch statement. How do I compare the RGB values and with what do I compare it to.

Is there a function that gives as output the RGB values of a hole?

Is there any better way to do it?

 

EDIT SELECTION MODEL CLEAR
EDIT SELECTION MODEL FILTER "250, 150, 150"

//CREATE HOLES

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 COMPOUND OFF
EDIT FEATURECREATE HOLES OPEN ON
EDIT FEATURECREATE MIN_ARC_ANGLE "60"
EDIT FEATURECREATE CREATEHOLES
FORM CANCEL CREATEHOLE

//RENAMING FEATURE SET 1 TO " "

 

 

 

3 REPLIES 3
Message 2 of 4
rafael.sansao
in reply to: Anonymous

Hello,

You can verify that after the color selection command, some color has actually been found in the model.

 

 

EDIT MODEL ALL DESELECT ALL
EDIT SELECTION MODEL CLEAR
EDIT SELECTION MODEL FILTER "250, 150, 150"

INT $Count = 0
FOREACH $Mod IN FOLDER('model') {
    $Count =  $Count + number_selected($entity('model',$Mod.name).components)
}
IF $Count == 0 {
	MESSAGE ERROR "No surface selected!"
	MACRO ABORT ALL
}

 

Rafael Sansão

EESignature

Message 3 of 4
Anonymous
in reply to: rafael.sansao

I don't want it to terminate the current macro. I want it to move on to recognizing the next color.

Thanks

Message 4 of 4
rafael.sansao
in reply to: Anonymous

EDIT MODEL ALL DESELECT ALL
EDIT SELECTION MODEL CLEAR
EDIT SELECTION MODEL FILTER "250, 150, 150"

INT $Count = 0
FOREACH $Mod IN FOLDER('model') {
    $Count =  $Count + number_selected($entity('model',$Mod.name).components)
}
IF $Count > 0 {
	//CREATE HOLES
	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 COMPOUND OFF
	EDIT FEATURECREATE HOLES OPEN ON
	EDIT FEATURECREATE MIN_ARC_ANGLE "60"
	EDIT FEATURECREATE CREATEHOLES
	FORM CANCEL CREATEHOLE
}

Rafael Sansão

EESignature

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report