i am currently working on a script which imports information about luminares from an AutoCAD drawing. Since i can’t add block informations nor rename the layers my blocks are on, i started working with a schedule i can import via the dwg. (this is the only way i found since we are working with DIALux and it is a pain in the a**).
The import, the translation from CADText to strings and the comparison with my personal excel translation list works just fine. But while scaling it up and adding more and more luminares i came across one which starts a new line in the AutoCAD schedule.
When reading the CADText with the new line in it, Dynamo fills the new line space with a slightly wider space but not a “\n” new line command. So i am not able to compare this string with any other, nor replace the double space with a single one.
First of all i found a workaround, though i am not really happy with it:
I split up the string into a list and put it back together, for some reason it deletes the spaces perfectly
wertsplit = wert2.split()
wert2 = “”
for wert in wertsplit:
if wert2 == “”:
wert2 = wert
else:
wert2 = wert2 + " " + wert
OUT = wert2
Now to your suggestion @jacob.small, thank you for your idea.
I exported the string via the “FileSystem.WriteText” node to a .txt test.txt (45 Bytes)
For me this looks like a new line created with enter. Even encoding it to utf-8 only sees a new line.
@Mark.Ackerley I tried that as well, it changed nothing. Even replacing (" “,”") just deletes the spaces but not the new line