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 " "
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
I don't want it to terminate the current macro. I want it to move on to recognizing the next color.
Thanks
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
Can't find what you're looking for? Ask the community or share your knowledge.