Get the cplane of a blockinstance

With RhinoScript can I get the cplane from a block instance ?

I am trying to get the height,width,length of blockinstances so I can export to csv.


Not very direct but transformed a circle to the block instance xform - and got the curveplane

Dim strObject, arrMatrix, crv

strObject = Rhino.GetObject("Select block to query")

If Rhino.IsBlockInstance(strObject) Then

	arrMatrix = Rhino.BlockInstanceXform(strObject)

	If IsArray(arrMatrix) Then

		crv = Rhino.AddCircle(rhino.ViewCPlane("top"), 1)

		Rhino.TransformObject crv, arrMatrix

	End If

End If

Dim box
box = rhino.BoundingBox(strObject, rhino.CurvePlane(crv))

Dim distx, disty, distz
distx = rhino.Distance(box(0), box(1))
disty = rhino.Distance(box(0), box(3))
distz = rhino.Distance(box(0), box(4))

rhino.print "x=" & round(distx, 2) & " y=" & round(disty, 2) & " z=" & round(distz, 2)

rhino.DeleteObject crv

You can also just use arrBlockPlane =Rhino.PlaneTransform(Rhino.WorldXYPlane(),arrMatrix) to get the correct block frame plane. Just another way.


1 Like

Very elegant, thanks for your help Jarek :wine_glass: