Sorry, I was referring to the text below it with the this and that statement.
I have made a monster of a program but since you know a little about PCBs I can tell you what I am doing.
First I start with a substrate. Then I deposit 1 mm thick copper on top of that which I make into a component.
At this point things get a little complicated because the etch depth could be less than the thickness of the copper layer.
First I have to copy the copper previous instance.
# Will be used to subtract from the copper definition
temp_subtractor = copper.definition.entities.add_instance(copper.definition, copper.transformation)
Then I use an etch mask to pattern into the copper using the subtract function
# Get the copper that needs to be removed
copper_to_be_removed = etch_mask.subtract(temp_subtractor)
Then Ideally, I would subtract that from the copper component. (although, this doesn’t work properly since subtract returns a group)
# remove the copper not in the mask.
copper = copper.subtract(copper_to_be_removed)
*EDIT: I forgot to answer one of your questions. The copper component is created in a separate function in the module but needs to be called and modified more than once.
I can create a standalone program so you can understand what I am dealing with if you would like.