-
-
Notifications
You must be signed in to change notification settings - Fork 745
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove \n
's if exported to an .ODS.
#4497
Comments
This is a bit of a more subtle bug. Firstly, let's say an IFC text attribute contained a new line (e.g. Now let's say you actually have a new line in your data. Will that be exported into ODS? Nope. We use Pandas' In the future we can build our own ODS exporter like we already do in IfcFM and add the Now the next issue ... your material names never had new lines in it. In fact, you actually had the literal What a mouthful. In short, run this script which'll convert your fakes to real newlines. import ifcopenshell
f = ifcopenshell.open('/path/to/your/model.ifc')
for e in f.by_type("IfcMaterial"):
e.Name = e.Name.replace("\\n", "\n")
f.write('/path/to/fixed.ifc') |
Thanks @Moult! I extended the script to catch the following too...
|
Had to add the following error exception to bypass some errors.
|
Huh, I can only imagine the type of exception there to be if the literal was null, which shouldn't occur. There must be another hidden bug somewhere. |
Would be nice if the
\n
would be removed, if exported to an .ODS.Either that, or have the newline show in the .ODS.
Not sure the best approach.
The text was updated successfully, but these errors were encountered: