Trying to insert blocks with xform in a GH Python Component

Hi All,

I’m trying to insert blocks into a Rhino file from a GH Python component, and I’m having trouble getting them placed correctly. Put simply, I need to place a block at a specified plane and possibly mirror it about the y-axis of this plane. I’m currently using the rs.InsertBlock2 command because it looks like I can include the mirror command with it, but I’m unclear about how to build the 4x4 transformation matrix that the command needs. I’ve checked over the forums for documentation of this, but can’t find a step-by-step guide to work off of.

From what I can gather, this is what I need to do:

  1. Define the plane to insert the block at
  2. Define the mirror axis if the block is mirrored
  3. Put these transforms into a 4x4 transformation matrix
  4. Run the rs.InsertBlock2 command to place the blocks correctly.

It’s #3 that I’m stuck on.

Any help would be greatly appreciated!