Hello,
I was wondering if it is possible to convert a point which is made of double values for X,Y,Z coordinates into same thing, but made of string with accurate number without rounding, as string.
for example Dynamo would tell me that this number 321.0000000345 is 321 if it is a double, but it is not correct, then I choose to convert to string with the value that the number it really is.
I used this python to do the translation from double to string but it needs rework after that to present it as the definition of a point: example of the output desired:
Point(X = 0.0, Y = 3.0, Z = 321.0000000345).
but what revit told me it is: Point(X = 0, Y = 3, Z = 321) or Point(X = 0.000, Y = 3.000, Z = 321.000)
not sure if this can be done in a single python node, input as a list of points and output the same but a point built of strings with the real decimals.
import clr
def tolist(obj1):
if hasattr(obj1,"__iter__"): return obj1
else: return [obj1]
def output1(l1):
if len(l1) == 1: return l1[0]
else: return l1
num1 = tolist(IN[0])
out1 = []
for i in xrange(len(num1)):
s1 = str(num1[i])
if s1[-2:] == ".0": out1.append(s1[:-2])
else: out1.append(s1)
OUT = output1(out1)