Picking objects from Layout space

Hi I’d like to adapt this snipet to work in Layout space on objects that are in model space. I don’t have any experience with the methods that allow picking model space objects from layout space. I’d appreciate anyone pointing me in the right direction. (I’m not yet in Python world unfortunately)


Dim strObj, strBlkName, arrObjects

Call LabelBlock()

Sub LabelBlock()

	'get block
	strObj = Rhino.GetObject ("Select Part Block:", 4096, True)

	If Rhino.IsBlockInstance(strObj) Then

		strBlkName = Rhino.BlockInstanceName(strObj)

		Rhino.Command "-Leader Pause Pause Pause Enter " & chr(34) & strBlkName & chr(34)
		arrObjects = Rhino.LastCreatedObjects

		If IsArray(arrObjects) Then

			Rhino.SelectObjects arrObjects
			Rhino.Command "BringForward"

		End If

	End If
End Sub

I’m afraid you’ll need to learn python and a bit of rhinocommon. It isn’t particularly hard. See this link…

1 Like

and here is another link…

That’s exactly what I’m wanting to do, thanks.