Hi ! I use a macro connected to face 5 and when the elements overlap, the macro does not work correctly.. what can I do?
Your macro works flawlessly!
It seems to me that you overlooked that behind the board containing the macro there are 3 boards, not just one.
This can be seen if you turn on the debug function. (Ladybug icon)
Notice that three connections have appeared: 0, 1, 2.
By clicking on the numbers, you can see which objets are concerned
On the far left and on the far right there are two more boards that have a lateral orientation (Divider and Divider1). And they are also great candidates for a macro because they touch the main object and are on the right side (Connect=5).
If you want to exclude them from the macro, you need to check some condition specific to them. In this case it can be their width.
Check if the width of the second object is less than 100 (for example) and then set the drill count to zero. In the specific case of your macro, the simplest thing is to introduce an additional variable to allow drilling.
We will call it “DrillPass” which will receive values of zero or one depending on the completion of drilling.
We will create it in the [FORMULA] section.
DrillPass=IF ( obj2.width < 100; 0 ; 1 )
In the line to determine the number of holes, use it as a factor.
GB=if(CONECTOR_TYPE=0;CONECTOR_NUMBER;0) * DrillPass
Here are all the changes:
This is how the element looks after the changes.