L
by Lolalola1985 on 3 Feb 2023, edited 4 Feb 2023
#
Hi,
I am new here and I am trying to figure out how to change the project name of my my IFC file with code.
my ifc project is like this:
IFCPROJECT('3ZP7Iz_zX5EAHhd83K6qGX',#42,'0001',$,$,'Project Name','Project Status',(#114),#109);
I want to change Project Name by a new one
I was trying to do something like this
project.remove("Project Name")
Traceback (most recent call last):
File "<blender_console>", line 1, in <module>
ValueError: list.remove(x): x not in list
I am not sure how to do this.
A
by Arv on 3 Feb 2023
#
you could try this
project.Name = "New Name"
L
by Lolalola1985 on 3 Feb 2023
#
I tried it but it gave an error
project.Name = "New Name"
Traceback (most recent call last):
File "<blender_console>", line 1, in <module>
AttributeError: 'list' object has no attribute 'Name'
L
by Lolalola1985 on 3 Feb 2023
#
+1 votes
Hi,
It was missing just to specify the project by guid
and it worked.
Thanks!
M
by Moult on 4 Feb 2023
#
You likely have a list object because you are doing ifc_file.by_type("IfcProject"), which returns a list (since potentially there could be more than one element found). So you could do ifc_file.by_type("IfcProject")[0] to ensure you get the first (and only) project in the model.