I’m building a script in RhinoPython and rhinoscriptsytax that will plot two small squares next to an angled, larger square. The setup is supposed to look like this:
Right now, when I run the code for the first time after opening Rhino, it looks like this:
What’s happening is that the two squares plot on top of each other at the origin [0,0,0]. I am using blocks to handle the plotting.
Here’s my current code:

Class of functions used to plot the squares:
class vizRhino:
# Prepares data from line segments def data_prep(self, line_set): lineSeg_x = [[0 for x in range (2)] for y in range(len(line_set))] lineSeg_y = [[0 for x in range (2)] for y in range(len(line_set))] lineSeg_z = [[0 for x in range (2)] for y in range(len(line_set))] for i in range(len(line_set)): for j in range(2): if j == 0 : lineSeg_x[i][j] = float(line_set[i].start.x.value) lineSeg_y[i][j] = float(line_set[i].start.y.value) lineSeg_z[i][j] = float(line_set[i].start.z.value) else: lineSeg_x[i][j] = float(line_set[i].end.x.value) lineSeg_y[i][j] = float(line_set[i].end.y.value) lineSeg_z[i][j] = float(line_set[i].end.z.value) return lineSeg_x, lineSeg_y, lineSeg_z # Plots line segments def Line(self, num, lineX, lineY, lineZ, coords, color): block = [] for i in range(len(lineX)): line = rs.AddLine((lineX[i][0], lineY[i][0], lineZ[i][0]), (lineX[i][1], lineY[i][1], lineZ[i][1])) block.append(line) rs.ObjectColor(line, [199,21,133]) rs.AddBlock(block, [0,0,0], 'block %i'%num, delete_input = True) rs.InsertBlock('block %i'%num, coords) # Plots point/Updates point location def Point(self, pointSource): for i in pointSource: pt = rs.AddPoint(float(i.value.x.value), float(i.value.y.value), float(i.value.z.value)) rs.ObjectColor(pt, [199,21,133]) return pt

Plotting as called within the main code
RULE PLOTTING
ruleSides = [r.lhs, r.rhs] count = 1 for j in range(len(ruleSides)): block = [] lineX, lineY, lineZ = viz.data_prep(ruleSides[j].elements[1].elements) for i in range(len(lineX)): line = rs.AddLine((lineX[i][0], lineY[i][0], lineZ[i][0]), (lineX[i][1], lineY[i][1], lineZ[i][1])) block.append(line) rs.ObjectColor(line, [199,21,133]) if count1 == 0: coords = [5.5,1,0] rs.AddTextDot("LHS",(5.5,1,0)) elif count1 == 1: coords = [2,1,0] rs.AddTextDot("RHS",(2,1,0)) point = viz.Point(ruleSides[j].elements[0]) block.append(point) rs.AddBlock(block, coords, 'block %i'%count, delete_input = True) rs.InsertBlock('block %i'%count, coords) count+=1
This code is causing the plot to look like that of the second picture. My goal is to get it to plot the squares separately and away from each other from the very first run after I open Rhino. When I run the code subsequent times, the squares are plotted in the correct place, so I’m not sure if this is a mistake with how I handle the block instances?