I’m trying to write a script that will place families according to a coordinate system. I have this mostly working, but am getting some issues when trying to place families that are mirrored (FacingFlipped or HandFlipped). This fits into a system where we want to record family positions to generate in different contexts. Basically a desynchronous ‘copy’ command.
In my testing i’m getting some very strange behavior where the FamilyInstance.Location value of the new family does not match the point used to define the coordinate system if the family is flipped.
accounting for the hand and facing flips is giving me trouble. Here’s my test script:
Is it possible to place a mirrored family instance with the coordinate system alone? or can this only be done in two steps: FamilyInstance.ByCoordinateSystem → HandFlipped? I’m trying to make this pretty generic so the cs data can be simply stored and elements can be generated in one command.
Magenta toilet family is a reference from a project. model geometry exists in the lower left quadrant. I’ve included an annotation to indicate the family origin graphically. The trapezoid is a test family with geometry existing in the upper right quadrant
Rotation works:
But mirroring the target family doesn’t create the correct change in the new family
And then lots of very strange behavior when creating a different type of the same family
This last test makes me think there is something incorrect with the way this family is built…
My approach is to create the coordinate system assuming that the family is not mirrored and that the z axis is the canonical Z. then you should just be able to mirror the cs used for generation, right? I think i’m missing something here.