d.Z = 3; }
but it doesnot work....the error is: centroid is a return value....
someknow how to set position?
yes ,of course i can use transform,but you need to calculate the vector which minus the origin position...it takes time and not efficient...i just need to set the final centroid position of curve...
Thank you!…
lections import defaultdict
example_list = [[1,2,4], [1,2,3], [3,4,3], [1,2,3], [5,7,1], [3,4,3], [5,7,1], [1,2,4], [9,4,9], [9,3,9], [9,4,9]]
d = defaultdict(list)
for item in example_list: d[tuple(item)].append(item)
groupedlist = sorted(d[x] for x in d)
print groupedlist
# Returns [[[1, 2, 3], [1, 2, 3]], [[1, 2, 4], [1, 2, 4]], [[3, 4, 3], [3, 4, 3]], [[5, 7, 1], [5, 7, 1]], [[9, 3, 9]], [[9, 4, 9], [9, 4, 9]]]
____________________________________________________
However working with python inside GH the code fails as (I'm assuming the id is included in the list ie.
[<Rhino.Geometry.Point3d object at 0x0000000000000BD0 [1611664.12669822,2952929.94466619,5788.70761766478]>]
If I print my object[0] i get just the vector, i.e [1611664.12669822,2952929.94466619,5788.70761766478]
However if i append my object, (for i in xrange (len(X)... list.append(my object[x])
The id included!?
[<Rhino.Geometry.Point3d object at 0x0000000000000BD0 [1611664.12669822,2952929.94466619,5788.70761766478]>]
Perhaps I'm over complicating this and should just use GH to group objects with the same position...
Also sometimes when getting vectors I receive long numbers such as.. 9.0122222900391e(10), and another times I don't.... Same file, script, geometry etc..
I'm quite a noobie in python for GH so any help or pointers are welcome...
Thank you in advance!
…
llowing code where it says your code here
If IsDBNull(x) Then
A = 0 'replace this with the value you need
Else
A = x
End If
3. you only need one input therefore you can delete the default y input in the input manager
Regards,
Tobias…