I see no documentation of how to generate a list like:
Code: Select all
pl1 = (
(0.0, 61.43, 0.0),
(42.80, 61.40, 0.0),
(71.25, 41.79, 0.0),
(75.16, 0.0, 0.0),
(61.76, 0.0, 0.0),
(43.88, 41.39, 0.0),
(-1.307, 48.159, 0.0),
(0.0, 61.43, 0.0)
)
I can generate a list like:
Code: Select all
multiplelist [[0.0, 88.89999999999999, 0], [44.44999999999999, 76.9896583964366, 0], [0.0, 88.89999999999999, 0], [-127.0, 88.89999999999999, 0], [44.44999999999999, 76.9896583964366, 0], [76.9896583964366, 44.45000000000001, 0], [76.9896583964366, 44.45000000000001, 0], [88.89999999999999, 5.443555022209985e-15, 0], [88.89999999999999, 5.443555022209985e-15, 0], [76.9896583964366, -44.449999999999974, 0], [76.9896583964366, -44.449999999999974, 0], [44.44999999999999, -76.9896583964366, 0], [44.44999999999999, -76.9896583964366, 0], [1.088711004441997e-14, -88.89999999999999, 0], [1.088711004441997e-14, -88.89999999999999, 0], [-126.99999999999999, -88.89999999999999, 0], [-126.99999999999999, -88.89999999999999, 0], [-171.45000000000002, -76.9896583964366, 0], [-171.45000000000002, -76.9896583964366, 0], [-203.98965839643657, -44.45000000000004, 0], [-203.98965839643657, -44.45000000000004, 0], [-215.89999999999998, -1.6330665066629955e-14, 0], [-215.89999999999998, -1.6330665066629955e-14, 0], [-203.9896583964366, 44.45000000000001, 0], [-203.9896583964366, 44.45000000000001, 0], [-171.45000000000005, 76.98965839643657, 0], [-171.45000000000005, 76.98965839643657, 0], [-127.00000000000003, 88.89999999999999, 0]]
I am in a for loop:
Code: Select all
# top code to get inputs
for M in range(1, NTIMES + 1):
KOUNT = KOUNT + 1
DEGREE = DEGREE + PART
TODEGREE = DEGREE + PART
C1=R*math.cos(math.radians(DEGREE))
H1=R*math.sin(math.radians(DEGREE))
A1=H1/math.cos(math.radians(DEG))
C11=R*math.cos(math.radians(TODEGREE))
H11=R*math.sin(math.radians(TODEGREE))
A11=H11/math.cos(math.radians(DEG))
if M <= SQSTART:
#group.addObjects(Draft.make_wire([Vector(A1 * convert, C1 * convert, 0), Vector(A11 * convert, C11 * convert, 0)], closed=False))
group.addObjects([Draft.makeWire([Vector(A1 * convert, C1 * convert, 0), Vector(A11 * convert, C11 * convert, 0)])])
multlist.append([A1 * convert, C1 * convert, 0])
multlist.append([A11 * convert, C11 * convert, 0])
if M == 1:
print('coord',A1 * convert, C1 * convert, 0)
#group.addObjects([Draft.makeWire([Vector(x1, y1, z1), Vector(x2, y2, z2)])])
#group.addObjects(Draft.make_wire([Vector(A1 * convert, C1 * convert, 0), Vector((A1 * convert) - STRT, C1 * convert, 0)], closed=False))
group.addObjects([Draft.makeWire([Vector(A1 * convert, C1 * convert, 0), Vector((A1 * convert) - STRT, C1 * convert, 0)])])
multlist.append([A1 * convert, C1 * convert, 0])
multlist.append([(A1 * convert) - STRT, C1 * convert, 0])
if M == HTIME:
print('coord',A1 * convert, C1 * convert, 0)
#group.addObjects(Draft.make_wire([Vector(A11 * convert, C11 * convert, 0), Vector((A11 * convert) - STRT, C11 * convert, 0)], closed=False))
group.addObjects([Draft.makeWire([Vector(A11 * convert, C11 * convert, 0), Vector((A11 * convert) - STRT, C11 * convert, 0)])])
multlist.append([A11 * convert, C11 * convert, 0])
multlist.append([(A11 * convert) - STRT, C11 * convert, 0])
if M > SQSTART:
#group.addObjects(Draft.make_wire([Vector(A1 * convert - STRT, C1 * convert, 0), Vector(A11 * convert - STRT, C11 * convert, 0)], closed=False))
group.addObjects([Draft.makeWire([Vector(A1 * convert - STRT, C1 * convert, 0), Vector(A11 * convert - STRT, C11 * convert, 0)])])
multlist.append([A1 * convert - STRT, C1 * convert, 0])
multlist.append([A11 * convert - STRT, C11 * convert, 0])
print('multiplelist', multlist)
Still, it seems there should be an easy way in python to convert to a wire instead of python making it a block.
I am trying now to figure out how to loop over the multilist to generate a wire. Python doesn't make it easy.
If I go this route, I will delete lines like:
Code: Select all
group.addObjects([Draft.makeWire([Vector(A1 * convert, C1 * convert, 0), Vector(A11 * convert, C11 * convert, 0)])])
And then work with the list. Just seems like a lot of work, when all I want to do is convert to wire and delete existing lines in the group.
Edit:
If I can live with block instead of wire, how do you in python delete the group created? That would help. I can live with just deleting the whole group.