Block Transform Info

Hi I need to read the information about a block, how it was trnasformed from its original position. Cant find any info on how this is listed or how to access it.

example of info from WHAT, 12 seperate bits of data, if I assume position , scale , rotation I get 9.

What am I looking at, and for example if I knew original scale, location and rotation of the block, how can I access this info to determine how it transformed, for example to measure the current size of the block in relation to its original size?

Block Instance
  transformation:
    0.12790842443283043, -0.011492650154887275, -0.077507121940685375, -4.1975822785495396
    0.021765425319342915, 0.14774965431392495, 0.014010921125456904, 2.2725170261647651
    0.075270852391739237, -0.023193935468846849, 0.12765711941638022, 11.031683325180133
    0, 0, 0, 1

The info you’re looking at is, I think, a 4x4 transformation matrix (look at the characteristic 0,0,0,1 on the last line).

This bit of code give you access to the instance transformation matrix.

ObjRef p1;
RhinoGet.GetOneObject("Select block", false, ObjectType.AnyObject, out p1);

var obj = p1.Object();

InstanceObject io = obj as InstanceObject;
if (null != io)
{
    Transform t = io.InstanceXform;
    RhinoApp.WriteLine(t.ToString());
}

return Result.Success;

Thanks , that’s half my puzzle.

found this now you mentioned 4x4 matrix, thanks

Thank you for the help, command now succesfull, can locate, and size all the block instance and update model according.

What is the geometry filter to select ONLY block instances when the user gets?

There are two object types, ObjectType.InstanceDefinition and ObjectType.InstanceReference. I think you need the last one, but I’m not sure.

1 Like

sweet it was ObjectType.InstanceReference

works like a charm now, many thanks

1 Like