Skip to content

Commit

Permalink
Arch: import IFC and helper, code formating, E261 at least two spaces…
Browse files Browse the repository at this point in the history
… before inline comment
  • Loading branch information
berndhahnebach committed Aug 29, 2019
1 parent 4fd1827 commit 99fa0b3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
16 changes: 8 additions & 8 deletions src/Mod/Arch/importIFC.py
Expand Up @@ -232,10 +232,10 @@ def insert(filename,docname,skip=[],only=[],root=None,preferences=None):

# IfcOpenShell multiplies the precision value of the file by 100
# So we raise the precision by 100 too to compensate...
#ctxs = ifcfile.by_type("IfcGeometricRepresentationContext")
#for ctx in ctxs:
# if not ctx.is_a("IfcGeometricRepresentationSubContext"):
# ctx.Precision = ctx.Precision/100
# ctxs = ifcfile.by_type("IfcGeometricRepresentationContext")
# for ctx in ctxs:
# if not ctx.is_a("IfcGeometricRepresentationSubContext"):
# ctx.Precision = ctx.Precision/100

# set default ifcopenshell options to work in brep mode
from ifcopenshell import geom
Expand Down Expand Up @@ -623,7 +623,7 @@ def insert(filename,docname,skip=[],only=[],root=None,preferences=None):
for attribute in ArchIFCSchema.IfcProducts[product.is_a()]["attributes"]:
if attribute["name"] == "Name":
continue
#print("attribute:",attribute["name"])
# print("attribute:",attribute["name"])
if hasattr(product, attribute["name"]) and getattr(product, attribute["name"]) and hasattr(obj,attribute["name"]):
#print("Setting attribute",attribute["name"],"to",getattr(product, attribute["name"]))
setattr(obj, attribute["name"], getattr(product, attribute["name"]))
Expand Down Expand Up @@ -726,7 +726,7 @@ def insert(filename,docname,skip=[],only=[],root=None,preferences=None):
if preferences['DEBUG']:
print("property NominalValue",l.NominalValue.is_a(),type(l.NominalValue.is_a()))
print("property NominalValue.wrappedValue",l.NominalValue.wrappedValue,type(l.NominalValue.wrappedValue))
#print("l.NominalValue.Unit",l.NominalValue.Unit,type(l.NominalValue.Unit))
# print("l.NominalValue.Unit",l.NominalValue.Unit,type(l.NominalValue.Unit))
ifc_spreadsheet.set(str('C'+str(n)), l.NominalValue.is_a())
if l.NominalValue.is_a() in ['IfcLabel','IfcText','IfcIdentifier','IfcDescriptiveMeasure']:
if six.PY2:
Expand Down Expand Up @@ -1075,8 +1075,8 @@ def insert(filename,docname,skip=[],only=[],root=None,preferences=None):
# Materials

if preferences['DEBUG'] and materials: print("Creating materials...",end="")
#print("mattable:",mattable)
#print("materials:",materials)
# print("mattable:",mattable)
# print("materials:",materials)
fcmats = {}
for material in materials:
# get and set material name
Expand Down
4 changes: 2 additions & 2 deletions src/Mod/Arch/importIFCHelper.py
Expand Up @@ -579,8 +579,8 @@ def getVector(entity,scaling=1000):
v = FreeCAD.Vector(tuple(entity.Coordinates))
else:
v = FreeCAD.Vector(tuple(entity.Coordinates+[0]))
#if v:
# v.multiply(scaling)
# if v:
# v.multiply(scaling)
return v


Expand Down

0 comments on commit 99fa0b3

Please sign in to comment.