I have some code that works out what a Colour Code suffix should be depending on the Material that is selected. I want to reuse this code across several files (parts) I have read that this might be possible using subcomponents and superseding but not sure how to implement this as I want to return a value depending on the input, for example this is the code I want to reuse...
if(supplyMFC=='Yes'){
if(mfcColour=='racksystems_test:graphite'){
pc='-GR';
}
if(mfcColour=='racksystems_test:oak'){
pc='-OA';
}
if(mfcColour=='racksystems_test:white'){
pc='-WH';
}
if(mfcColour=='racksystems_test:greyoak'){
pc='-GO';
}
if(mfcColour=='racksystems_test:walnut'){
pc='-WN';
}
if(mfcColour=='racksystems_test:beech'){
pc='-BE';
}
if(mfcColour=='racksystems_test:cherry'){
pc='-CH';
}
if(mfcColour=='racksystems_test:orange'){
pc='-XX';
}
}