Help on SplitBrep

Hi all,

i’m trying to split an object from center world by making a cutplane and use it as cutter, but something is wrong i my (poor) script, i got an error message “string required” in SplitBrep line , i think the problem come from arrObjects .

any help ?

Thanks.

Dim arrObjects, arrPt0, arrPt1, arrNormal, strCutter

arrObjects = Rhino.GetObjects(“Select objects for ZTrim”, True, True)

arrPt0 = array(0, 0, 0)
arrPt1 = array(0, 1, 0)
arrNormal = array(1, 0, 0)

If IsArray(arrObjects) Then

  Rhino.AddCutPlane arrObjects, arrPt0, arrPt1, arrNormal
  strCutter = Rhino.FirstObject
  '		Rhino.Print strCutter
  Rhino.SplitBrep arrObjects, strCutter

End If

Hi

Exactly.
Rhino.SplitBrep() needs a single object ID as its first argument, not an array.
This seems to work

arrObjects = Rhino.GetObjects("Select objects for ZTrim",, True, True)

arrPt0 = array(0, 0, 0)
arrPt1 = array(0, 1, 0)
arrNormal = array(1, 0, 0)

If IsArray(arrObjects) Then

	strCutter = Rhino.AddCutPlane(arrObjects, arrPt0, arrPt1, arrNormal)
	For Each strObject In arrObjects
		Rhino.SplitBrep strObject, strCutter
	Next

End If
1 Like

HI Emilio,

what I thought, but i wasn’t really know how to solve this, it’s more clear now, thanks for help.