Arch: More work on the IFC exporter
This commit is contained in:
parent
df596822a5
commit
990ece8ce8
|
@ -595,22 +595,27 @@ def addFixture(fixture,baseobject):
|
|||
else:
|
||||
FreeCAD.Console.PrintMessage(str(translate("Arch","This object has no support for fixtures")))
|
||||
|
||||
def getTuples(data):
|
||||
"""getTuples(data): returns a tuple or a list of tuples from a vector
|
||||
or from the vertices of a shape"""
|
||||
def getTuples(data,scale=1):
|
||||
"""getTuples(data,[scale]): returns a tuple or a list of tuples from a vector
|
||||
or from the vertices of a shape. Scale can indicate a scale factor"""
|
||||
import Part
|
||||
if isinstance(data,FreeCAD.Vector):
|
||||
return (data.x,data.y,data.z)
|
||||
return (data.x*scale,data.y*scale,data.z*scale)
|
||||
elif isinstance(data,Part.Shape):
|
||||
t = []
|
||||
for v in data.Vertexes:
|
||||
t.append((v.X,v.Y,v.Z))
|
||||
t.append(t[0]) # for IFC verts lists must be closed
|
||||
if len(data.Wires) == 1:
|
||||
import Part,DraftGeomUtils
|
||||
data = Part.Wire(DraftGeomUtils.sortEdges(data.Wires[0].Edges))
|
||||
for v in data.Vertexes:
|
||||
t.append((v.X*scale,v.Y*scale,v.Z*scale))
|
||||
t.append(t[0]) # for IFC verts lists must be closed
|
||||
else:
|
||||
print "Arch.getTuples(): Wrong profile data"
|
||||
return t
|
||||
|
||||
def getExtrusionData(obj):
|
||||
"""getExtrusionData(obj): returns a closed path (a list of tuples) and a tuple expressing an extrusion
|
||||
vector, or None, if a base loop and an extrusion direction cannot be extracted."""
|
||||
def getExtrusionData(obj,scale=1):
|
||||
"""getExtrusionData(obj,[scale]): returns a closed path (a list of tuples) and a tuple expressing an extrusion
|
||||
vector, or None, if a base loop and an extrusion direction cannot be extracted. Scale can indicate a scale factor."""
|
||||
if hasattr(obj,"Additions"):
|
||||
if obj.Additions:
|
||||
# provisorily treat objs with additions as breps
|
||||
|
@ -621,13 +626,13 @@ def getExtrusionData(obj):
|
|||
return None
|
||||
if hasattr(obj,"Proxy"):
|
||||
if hasattr(obj.Proxy,"BaseProfile") and hasattr(obj.Proxy,"ExtrusionVector"):
|
||||
return getTuples(obj.Proxy.BaseProfile), getTuples(obj.Proxy.getExtrusionVector)
|
||||
return getTuples(obj.Proxy.BaseProfile,scale), getTuples(obj.Proxy.ExtrusionVector,scale)
|
||||
return None
|
||||
|
||||
def getBrepFacesData(obj):
|
||||
"""getBrepFacesData(obj): returns a list(0) of lists(1) of lists(2), list(1) being a list
|
||||
def getBrepFacesData(obj,scale=1):
|
||||
"""getBrepFacesData(obj,[scale]): returns a list(0) of lists(1) of lists(2), list(1) being a list
|
||||
of vertices defining a loop, list(1) describing a face from one or more loops, list(0)
|
||||
being the whole object made of several faces."""
|
||||
being the whole object made of several faces. Scale can indicate a scaling factor"""
|
||||
if hasattr(obj,"Shape"):
|
||||
if obj.Shape:
|
||||
if obj.shape.isValid():
|
||||
|
@ -636,7 +641,7 @@ def getBrepFacesData(obj):
|
|||
for face in obj.Shape.Faces:
|
||||
f = []
|
||||
for wire in face.Wires:
|
||||
f.append(getTuples(wire))
|
||||
f.append(getTuples(wire,scale))
|
||||
s.append(f)
|
||||
return s
|
||||
return None
|
||||
|
|
|
@ -34,7 +34,7 @@ __url__ = "http://www.freecadweb.org"
|
|||
QtCore.QT_TRANSLATE_NOOP("Arch","Wood")
|
||||
QtCore.QT_TRANSLATE_NOOP("Arch","Steel")
|
||||
|
||||
# Possible roles
|
||||
# Possible roles for structural elements
|
||||
Roles = ["Beam","Column","Slab","Wall","Containment wall","Roof","Foundation"]
|
||||
|
||||
# Presets in the form: Class, Name, Width, Height, [Web thickness, Flange thickness]
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
# Resource object code
|
||||
#
|
||||
# Created: Wed Nov 13 14:50:12 2013
|
||||
# Created: Tue Dec 17 17:13:28 2013
|
||||
# by: The Resource Compiler for PyQt (Qt v4.8.6)
|
||||
#
|
||||
# WARNING! All changes made in this file will be lost!
|
||||
|
@ -27568,94 +27568,108 @@ qt_resource_data = "\
|
|||
\x6c\x6c\x61\x64\x61\x20\x73\x75\x70\x70\x6f\x72\x74\x20\x77\x69\
|
||||
\x6c\x6c\x20\x62\x65\x20\x64\x69\x73\x61\x62\x6c\x65\x64\x2e\x0a\
|
||||
\x07\x00\x00\x00\x04\x61\x72\x63\x68\x01\
|
||||
\x00\x00\x05\x5f\
|
||||
\x00\x00\x06\x3f\
|
||||
\x00\
|
||||
\x00\x1f\xae\x78\x9c\xed\x59\x6d\x6f\xdb\x36\x10\xfe\x9e\x5f\x41\
|
||||
\xe8\xd3\x06\xa4\x55\x92\x26\x69\x6b\xc8\x2e\xd2\x34\x69\x03\x24\
|
||||
\xab\x03\x67\xdd\xc7\x80\x96\xce\x16\x57\x8a\xd4\x48\x2a\xb6\xfb\
|
||||
\xeb\x77\xa4\x68\x4b\x96\x95\x97\xc6\x71\x3a\x0c\x01\x0c\x58\x7c\
|
||||
\xd1\xdd\xf1\xd1\x73\xc7\x23\x2f\xfa\x30\xcd\x38\xb9\x01\xa5\x99\
|
||||
\x14\xdd\x60\xf7\xf5\x4e\x40\x40\xc4\x32\x61\x62\xdc\x0d\xfe\xbc\
|
||||
\x3a\x7d\xf5\x2e\xf8\xd0\xdb\x8a\x0a\x56\x4d\xda\xc7\x49\xbd\x2d\
|
||||
\x12\xc5\x9c\x6a\xdd\xfb\x5c\xb0\x4e\xe7\x13\xa3\x5c\x8e\xf1\x9f\
|
||||
\x8f\x07\x60\x0c\xbe\xac\x8f\x54\x9c\x46\x61\x39\x07\x27\x4f\x58\
|
||||
\x32\x06\x43\x5c\xbb\x1b\x5c\xfe\xe5\x9a\x01\x11\x34\x83\x6e\x70\
|
||||
\x97\x0c\xab\x8a\x44\xb9\x92\x39\x28\x33\xf3\x2f\x8c\x41\x66\x60\
|
||||
\xd4\xcc\x0d\x92\x48\x41\x6c\xdc\x13\x89\xa6\xbd\x9d\x28\x9c\xfa\
|
||||
\xc6\xcc\x36\x66\xbe\x81\x16\x98\xb4\x77\xf0\x66\x37\x0a\xcb\xc7\
|
||||
\xb2\x3b\x05\x36\x4e\x4d\xef\x60\xff\x5d\x14\xfa\x67\x27\x33\x9c\
|
||||
\x0b\x8d\xc2\xb9\xf2\x36\x4b\x26\x4c\x24\x72\x72\xc5\x0c\x07\x6f\
|
||||
\x8c\x36\x0a\x6d\xef\x9d\x65\xb9\x54\x86\x84\x04\xa6\xf6\x21\x0a\
|
||||
\x7d\xff\xaa\x44\x4e\x67\xb2\xa8\xa0\xf9\xf6\x51\x4e\xcf\x5d\x97\
|
||||
\x17\xd8\xd0\xa8\x73\x1a\xa3\xa0\xc0\xdb\x2f\x8a\x6c\x08\xaa\x77\
|
||||
\x18\x85\xfe\xa9\xb4\xbe\xae\x61\x45\x44\x46\xd5\x98\x89\x86\x84\
|
||||
\xf7\x77\x4a\x60\x06\xb2\x0a\xc8\xfa\xa7\xfc\xac\x64\x91\xa3\xcd\
|
||||
\xf3\x8f\x39\xf6\xed\xeb\x3d\xaf\x60\x45\xbd\xa9\xd0\xaa\x03\x76\
|
||||
\x7a\x4c\x58\xd6\xc4\x6a\xd5\x94\x3b\x11\xf3\x1a\x90\xab\x86\xc5\
|
||||
\x94\xd7\x71\x5c\x5e\x45\x8b\x98\x2f\x2b\x62\x52\xa9\xd8\x0f\x29\
|
||||
\xcc\x5c\xd0\xf5\xfb\x85\xa8\xa6\xb0\x15\x5c\x1c\xa7\xfb\x0a\x46\
|
||||
\xc7\x29\xc4\xdf\xeb\xf8\xd8\x81\x1c\x07\x62\x3b\x30\x44\xa0\x0e\
|
||||
\x6a\x52\x5b\xd0\x92\x92\x5f\xb1\x7c\x69\xce\x02\x34\x27\x9c\x98\
|
||||
\x94\x69\x62\x24\x49\x98\xce\x71\x51\x24\x81\x61\x31\x26\x19\x68\
|
||||
\x4d\xc7\xa0\xc9\x24\x65\x1c\x3c\xb6\xf8\x12\xb1\x48\x8f\xb0\x4b\
|
||||
\x37\x80\x6e\x47\xbb\xdd\x28\x98\x9a\x76\x8b\x06\xa9\x9c\x34\x0c\
|
||||
\x78\xbc\x1a\x0b\xd3\x89\xb0\x8e\x4e\xb4\x49\x34\x98\x6e\xb0\xd3\
|
||||
\x50\x1b\x7b\xd9\x6c\x14\x7f\xb2\x5a\x31\xe6\xac\xa3\xad\x4f\x4d\
|
||||
\x7a\xbf\xb2\x0b\x99\x84\x3e\xc0\x3d\x50\x99\x0b\x3a\x48\x8f\x1a\
|
||||
\x7f\xc2\x65\x36\x86\x25\x1d\x17\x5c\x5d\x1a\x5e\x9b\xb9\x07\x9b\
|
||||
\x60\xee\xe3\x79\x7b\x36\x2a\x49\x8b\x3f\x27\x0c\x92\xed\x8a\x96\
|
||||
\x64\xc2\x38\x27\x94\x4f\xe8\x4c\x93\xe1\x9c\xb9\x90\x60\xbf\x49\
|
||||
\xf1\x3d\xec\x11\x06\x94\xa0\x9c\xe4\x33\x93\x4a\x41\x72\xaa\x34\
|
||||
\xa8\x6d\x02\x37\x20\x08\x1b\x91\xb3\x51\xfc\x35\x07\x31\x48\x01\
|
||||
\x05\x59\x35\x42\x23\x14\x1c\x92\x4d\x30\xfe\x54\xaa\x18\x96\x2d\
|
||||
\x79\x16\xc6\x8f\xac\x5e\x5c\x69\xdf\x69\xee\x7b\xc5\x2f\xec\x6f\
|
||||
\x61\xff\x9b\x8d\xc4\xed\xbd\x35\xe2\xb6\x02\x6a\x90\xe9\x6e\xb3\
|
||||
\xd4\x04\x3f\x25\x01\x1a\xa7\xc4\xc2\x4a\xe4\xf0\x6f\xcc\x3d\x88\
|
||||
\x99\xe5\xb0\x09\xbe\xba\x0d\x9b\xc4\x12\xbd\x4a\x80\x30\xe8\x62\
|
||||
\x33\xa7\xeb\x79\xe2\x74\xec\x56\x8e\xb4\x75\x66\xe8\x17\xc2\xb6\
|
||||
\x12\x76\x77\x77\x23\x8c\x3d\x7c\xda\x88\x8d\x6f\x0b\x9b\xa7\x97\
|
||||
\x01\xbb\x1e\xa9\xa9\x26\xba\x18\x1a\x45\x63\x83\x67\x06\x8d\x53\
|
||||
\x31\x6c\xab\x09\xd3\x40\x26\x18\x88\x89\x4e\x69\x5e\x05\x7a\xa4\
|
||||
\x44\x32\x23\x29\xbd\x01\x1b\xdd\x99\xaa\x04\xcf\x85\x6c\x26\x72\
|
||||
\x0f\x00\xc3\x35\xb2\x71\xa1\xef\xb9\x32\x95\xb9\xe2\xaf\x0b\xbd\
|
||||
\x2f\x5e\xd0\xe6\x05\x7b\x1b\xf1\x82\xb7\x4f\xec\x05\x65\xb8\xb6\
|
||||
\x6f\x57\x9e\x60\x15\xb2\x69\x3d\x67\xb1\xe9\xcd\xd9\x27\x52\x9e\
|
||||
\xb1\x36\xc1\xe6\xbe\x53\xb9\xb0\x03\xd5\x3e\x81\xba\x9f\xe3\x75\
|
||||
\x69\xc2\x1f\x4e\xe7\x0b\xa9\x6f\x21\xf5\x4f\x24\x23\x97\xe7\x74\
|
||||
\x08\x7c\x2e\x8a\xdb\xc6\xf5\xfe\xdd\xec\xbd\x95\x1e\x27\xd3\x98\
|
||||
\x17\x09\x10\xce\xb4\xe9\x90\x07\x33\xe2\x5e\xb8\x1e\xec\x98\xe7\
|
||||
\x4c\xc0\x49\xc2\xcc\x8a\x63\x72\x1c\x00\x3b\xf0\x68\xb7\x3c\xb2\
|
||||
\xe9\x4c\x46\x5f\x69\x1f\x57\x13\xb7\x4a\x22\xdd\x49\x80\x60\x92\
|
||||
\xc3\x0c\x03\x77\x44\x06\x8f\xc2\x48\xc9\xac\xfd\xba\xe1\x76\x28\
|
||||
\x1e\x0e\x76\xf8\x08\xca\x73\x1a\x43\x2a\x79\x02\xea\xea\xd6\x6f\
|
||||
\x88\xab\x19\xe4\x38\x6f\x1b\x1f\x3e\x16\x8c\xdb\x6b\xba\x13\x0e\
|
||||
\x19\xae\xb0\xaf\xe4\x74\x66\xfb\x4f\xb9\x9c\x5c\x81\xca\x18\x9e\
|
||||
\x8f\x5c\xbb\x50\x82\xe9\xb4\x9a\xf9\x6c\x9b\xdc\x77\x96\xbf\xc4\
|
||||
\x80\xf6\x18\x70\xb8\x5e\x0c\xb8\x67\x07\xbb\x9d\x3f\xe5\xa5\x24\
|
||||
\x66\x67\xb8\x47\xa4\xa0\x3b\xff\xc5\x30\xb0\xce\xb9\xea\x8e\x40\
|
||||
\x80\xdb\xaf\x3b\xe5\xe0\x66\x4c\x0d\xc9\x0a\xec\x6e\x64\xac\x25\
|
||||
\x26\x6b\xb8\xc7\x03\x5d\xf8\x97\x79\xe4\x91\xbe\xc0\x25\xbe\xf8\
|
||||
\x64\x9b\x4f\xae\xe5\x90\x8f\x74\xc7\x63\x24\x21\x6e\x43\x96\x9a\
|
||||
\x1a\xd3\xc9\x8c\x92\xdf\xaa\x9b\x2d\x77\x9f\x43\xa4\xe0\xb3\xdf\
|
||||
\x7f\x81\x97\x9e\x32\x0e\xc7\xa9\x94\x68\xc3\x8a\xa3\xda\x4b\xba\
|
||||
\xd8\x8f\x3d\x11\x39\x4b\x24\xec\xf6\xe6\x70\xf8\x5f\x52\x74\x79\
|
||||
\x70\x49\x56\x6d\x5e\xbd\xd2\x62\x4b\x3d\xc8\x81\xe5\x9a\x86\x4b\
|
||||
\x00\x16\xc0\x37\x97\x8f\xac\xc6\x80\x42\xed\xa9\xbb\x2a\x7b\x00\
|
||||
\x9e\x02\x7a\x97\xa6\xd3\xf9\xe6\x65\x44\xa1\xeb\x9a\xdb\xd5\xac\
|
||||
\xaf\x34\x2b\x4e\xec\x07\x7c\x41\x62\xb6\x41\x1a\xd9\xc1\x6a\xfd\
|
||||
\x65\x65\x6d\x6f\x67\xa9\xc6\x66\x07\x7c\x69\x6d\x7f\x67\xa9\xca\
|
||||
\xe6\xb4\xd7\x24\x34\x4d\xc1\x41\xb7\xda\x06\x48\x35\x24\x6b\x30\
|
||||
\x7a\x9f\x4f\x60\x44\x0b\x6e\x88\xaf\x93\x75\x83\xc3\x80\x94\x05\
|
||||
\xaf\x6e\xb0\xbb\x1b\xd8\xd4\x2c\xca\xd9\x34\xa3\xf9\xa8\x10\xee\
|
||||
\x7a\xa2\xf7\x4f\xdf\xb5\x4f\x31\x27\xbc\x60\x19\x0c\x64\xa1\x62\
|
||||
\x40\x5b\x96\x67\xd9\x92\xa7\xa3\x69\xa9\x51\x3b\x4b\xea\x3d\xa5\
|
||||
\x95\xb5\xb2\x68\xcd\x89\xaa\x52\xa8\xfd\x1e\x53\x03\x22\xd1\x3d\
|
||||
\x5f\x06\xc5\xaf\xe1\x3b\xb6\x4a\xa8\x28\xee\x20\x56\x42\x68\x05\
|
||||
\x94\x75\xd1\xd7\xa9\x05\xce\x0d\x38\x00\x9a\x7a\xef\x36\xa4\xe1\
|
||||
\xd1\xad\xc6\xac\x5a\x7c\x9b\x55\x56\x5a\x69\xb9\x5e\xdf\xac\xf9\
|
||||
\x71\xbd\x1d\xa0\x6a\xf4\x59\x8c\x99\xe7\x26\xed\xc6\x54\xa3\xeb\
|
||||
\x1b\xb3\xdc\xe1\x4a\xe4\x0a\xb4\x23\x9e\x76\x14\x8d\xa5\x10\x50\
|
||||
\xde\x9e\x61\x3b\x0a\x0b\xd6\xdb\xfa\x17\x44\x95\x74\xdd\
|
||||
\x00\x25\xe2\x78\x9c\xed\x5a\x6d\x6f\xdb\x36\x10\xfe\x9e\x5f\x41\
|
||||
\xf8\xd3\x06\xa4\x51\x9c\x26\x69\x1b\xc8\x2e\xda\x24\x6e\x03\xb4\
|
||||
\xab\x0b\x67\xdd\xc7\x82\x96\xce\x16\x57\x4a\xd4\x48\x2a\xb6\xfb\
|
||||
\xeb\x77\xa4\x68\xeb\xc5\x72\x12\xdb\x71\x3a\x0c\x36\x02\x44\xe4\
|
||||
\x51\x77\xc7\xe3\x73\x2f\xa4\xe8\xbf\x9d\xc6\x9c\xdc\x81\x54\x4c\
|
||||
\x24\x9d\x56\xfb\xe8\xb8\x45\x20\x09\x44\xc8\x92\x71\xa7\xf5\xe7\
|
||||
\x6d\xef\xc5\xeb\xd6\xdb\xee\x81\x9f\xb1\x62\xd0\x29\x0e\xea\x1e\
|
||||
\x10\x3f\xe0\x54\xa9\xee\x87\x8c\x5d\x5c\x5c\x31\xca\xc5\x18\xff\
|
||||
\xf3\xf1\x00\xb4\xc6\x97\xd5\x3b\x19\x44\xbe\x97\x8f\xc1\xc1\x13\
|
||||
\x16\x8e\x41\x13\xdb\xee\xb4\xbe\xfe\x65\x9b\x2d\x92\xd0\x18\x3a\
|
||||
\xad\xfb\x78\x18\x51\xc4\x4f\xa5\x48\x41\xea\x99\x7b\x61\x0c\x22\
|
||||
\x06\x2d\x67\x96\x48\x7c\x09\x81\xb6\x4f\xc4\x9f\x76\x8f\x7d\x6f\
|
||||
\xea\x1a\x33\xd3\x98\xb9\x06\x6a\xa0\xa3\xee\xd9\xcb\xb6\xef\xe5\
|
||||
\x8f\x79\x77\x04\x6c\x1c\xe9\xee\xd9\xe9\x6b\xdf\x73\xcf\x96\xa7\
|
||||
\x37\x67\xea\x7b\x73\xe1\x4d\x9a\x4c\x58\x12\x8a\xc9\x2d\xd3\x1c\
|
||||
\x9c\x32\x4a\x4b\xd4\xbd\x7b\x13\xa7\x42\x6a\xe2\x11\x98\x9a\x07\
|
||||
\xdf\x73\xfd\xcb\x1c\x39\x9d\x89\xac\x30\xcd\xb7\xf7\x62\xfa\xc9\
|
||||
\x76\x39\x86\x35\x89\x2a\xa5\x01\x32\x6a\x39\xfd\x93\x2c\x1e\x82\
|
||||
\xec\x9e\xfb\x9e\x7b\xca\xb5\x2f\x4b\x58\x62\x11\x53\x39\x66\x49\
|
||||
\x8d\xc3\x9b\x7b\x39\x30\x0d\x71\x61\xc8\xf2\x52\x7e\x90\x22\x4b\
|
||||
\x51\xe7\xf9\x62\x8e\x5d\xfb\xfb\x89\x13\xb0\x24\x5e\x17\xd6\x2a\
|
||||
\x1b\xac\x77\x49\x58\x5c\xb7\xd5\xb2\x2a\xf7\x5a\xcc\x49\x40\xac\
|
||||
\x6a\x16\x50\x5e\xb6\x63\x75\x16\x0d\x6c\x3e\x2e\xb1\x89\x84\x64\
|
||||
\x3f\x45\xa2\xe7\x8c\xbe\xbf\x59\xb0\xaa\x33\x5b\xb2\x8b\xc5\x74\
|
||||
\x5f\xc2\xe8\x32\x82\xe0\x47\xd9\x3e\x86\x90\x22\x21\x30\x84\x21\
|
||||
\x1a\xea\xac\xc4\xb5\xc1\x5a\x42\xf0\x5b\x96\x56\xc6\x2c\x8c\x66\
|
||||
\x99\x13\x1d\x31\x45\xb4\x20\x21\x53\x29\x4e\x8a\x84\x30\xcc\xc6\
|
||||
\x24\x06\xa5\xe8\x18\x14\x99\x44\x8c\x83\xb3\x2d\xbe\x44\x8c\xa5\
|
||||
\x47\xd8\xa5\x6a\x86\x6e\xb6\x76\xb3\x52\x30\xd5\xcd\x1a\x0d\x22\
|
||||
\x31\xa9\x29\xb0\xb9\x18\x63\xa6\xeb\xc4\x38\x3a\x51\x3a\x54\xa0\
|
||||
\x3b\xad\xe3\x9a\xd8\xc0\xf1\x66\xa3\xe0\xca\x48\xc5\x98\xb3\x8d\
|
||||
\xb4\x3e\xd5\xd1\xc3\xc2\x3e\x8b\xd0\x73\x01\xee\x91\xc2\x6c\xd0\
|
||||
\x41\x78\x94\xf0\xe3\x55\xd1\xe8\xe5\x70\x5c\x60\xb5\x42\xde\x1a\
|
||||
\xb9\x67\xbb\x40\xee\xe6\xb8\xbd\x19\xe5\xa0\xc5\x3f\xcb\x0c\xc2\
|
||||
\xc3\x02\x96\x64\xc2\x38\x27\x94\x4f\xe8\x4c\x91\xe1\x1c\xb9\x10\
|
||||
\x62\xbf\x8e\xf0\x3d\xec\x49\x34\xc8\x84\x72\x92\xce\x74\x24\x12\
|
||||
\x92\x52\xa9\x40\x1e\x12\xb8\x83\x84\xb0\x11\xb9\x19\x05\x5f\x52\
|
||||
\x48\x06\x11\x20\x23\x23\x26\x51\x68\x0a\x0e\xe1\x2e\x10\xdf\x13\
|
||||
\x32\x80\xaa\x26\xcf\x82\xf8\x91\x91\x8b\x33\xed\x5b\xc9\x7d\x27\
|
||||
\x78\x8f\xfe\x06\xf4\xbf\xdc\x49\xdc\x3e\xd9\x22\x6e\x4b\xa0\x1a\
|
||||
\x91\x6e\x93\xa5\x22\xb8\x94\x04\x68\x10\x11\x63\x56\x22\x86\x7f\
|
||||
\x63\xed\x41\xf4\x2c\x85\x5d\xe0\xd5\x26\x6c\x12\x08\xf4\xaa\x04\
|
||||
\x12\x8d\x2e\x36\xb3\xb2\x9e\x27\x4e\x07\x76\xe6\x08\x5b\xab\x86\
|
||||
\xda\x03\xb6\x11\xb0\xed\xf6\x4e\x10\x7b\xfe\xb4\x11\x1b\xdf\x4e\
|
||||
\x4c\x9d\x9e\x07\xec\x72\xa4\xa6\x8a\xa8\x6c\xa8\x25\x0d\x34\xee\
|
||||
\x19\x14\x0e\xc5\xb0\x2d\x27\x4c\x01\x99\x60\x20\x26\x2a\xa2\x69\
|
||||
\x11\xe8\x11\x12\xe1\x8c\x44\xf4\x0e\x4c\x74\x67\xb2\x60\x3c\x67\
|
||||
\xb2\x9b\xc8\x3d\x00\x0c\xd7\x88\xc6\x85\xbc\xe7\xaa\x54\xe6\x82\
|
||||
\xbf\x2c\xe4\xee\xbd\xa0\xc9\x0b\x4e\x76\xe2\x05\xaf\x9e\xd8\x0b\
|
||||
\xf2\x70\x6d\xde\x2e\x3c\xc1\x08\x64\xd3\x72\xcd\x62\xca\x9b\x9b\
|
||||
\x2b\x92\xef\xb1\x76\x81\xe6\xbe\x15\xb9\xd0\x03\xc5\x3e\x81\xb8\
|
||||
\xf5\x70\x9d\xab\xf0\x87\x95\xb9\x07\xf5\x0a\x50\xaf\x51\x8c\x7c\
|
||||
\xfd\x44\x87\xc0\xe7\xac\xb8\x69\x7c\x3f\xbd\x1f\xbd\x2b\xe1\x71\
|
||||
\x3d\x0d\x78\x16\x02\xe1\x4c\xe9\x0b\xf2\x68\x44\x3c\x68\xae\x47\
|
||||
\x3b\xe6\x27\x96\xc0\x75\xc8\xf4\x92\x63\x72\x24\x80\x21\x6c\xec\
|
||||
\x96\xef\x4c\x39\x13\xd3\x17\xca\xc5\xd5\xd0\xce\x92\x08\xbb\x13\
|
||||
\x20\x58\xe4\x30\xcd\xc0\x6e\x91\xc1\x59\x61\x24\x45\xdc\x7c\xdc\
|
||||
\xb0\xda\x14\x8f\x37\xb6\xb7\x01\xe4\x39\x0d\x20\x12\x3c\x04\x79\
|
||||
\xbb\x72\x0d\x71\x36\x83\x14\xc7\x1d\xe2\xc3\xfb\x8c\x71\x73\x4c\
|
||||
\x77\xcd\x21\xc6\x19\xf6\xa5\x98\xce\x4c\x7f\x8f\x8b\xc9\x2d\xc8\
|
||||
\x98\xe1\xfe\xc8\xb6\x33\x99\x30\x15\x15\x23\x9f\x2d\xc9\xfd\x60\
|
||||
\xe9\x3e\x06\x34\xc7\x80\xf3\xed\x62\xc0\x03\x19\x6c\x35\x7e\xf2\
|
||||
\x43\x49\xac\xce\x30\x47\x44\xa0\x2e\xfe\x8b\x61\x60\x9b\x7d\xd5\
|
||||
\x3d\x81\x00\xd3\xaf\xdd\xe5\x60\x32\xa6\x9a\xc4\x19\x76\xd7\x2a\
|
||||
\xd6\xdc\x26\x5b\xb8\xc7\x23\x5d\xf8\x97\x79\xe4\x3b\xf5\x19\xa7\
|
||||
\xb8\xf7\xc9\x26\x9f\xdc\xca\x21\x37\x74\xc7\x4b\x04\x21\xa6\x21\
|
||||
\x03\x4d\x85\xe5\x64\x4c\xc9\x6f\xc5\xc9\x96\x3d\xcf\x21\x22\xe1\
|
||||
\xb3\xdf\x7f\x81\x97\xf6\x18\x87\xcb\x48\x08\xd4\x61\xc9\x51\xcd\
|
||||
\x21\x5d\xe0\x68\x4f\x04\xce\xdc\x12\x26\xbd\x59\x3b\xfc\x2f\x21\
|
||||
\x5a\x25\x56\x78\x95\xc6\x6d\xf0\xa5\x65\xfd\xef\x2c\xcb\xdf\xa4\
|
||||
\x9a\xa6\xbc\xee\x77\x96\x52\xe0\xde\x3a\x43\xae\xb1\xf3\x6b\x4a\
|
||||
\x90\x0f\xa4\x90\xd5\x27\x02\x38\x19\xf3\x89\x64\x44\x03\x2d\x1e\
|
||||
\xbf\x6d\x7a\x3a\xbf\xbb\x12\xd9\x90\xc3\x20\x65\x49\xd3\x16\x36\
|
||||
\xb4\x54\x85\xd4\xed\x4e\xdf\x17\x27\xed\x54\x82\xc9\x8a\x66\x0d\
|
||||
\xf9\x8c\x4c\x24\xd3\xda\x9c\xa0\x27\x24\xc6\x7d\x2c\x8b\x01\x83\
|
||||
\x91\x3a\xc2\x22\x9a\xe0\xa2\xd8\xc1\x13\x21\x7f\x18\x03\xe1\x10\
|
||||
\x4a\x42\x36\x1a\x81\xc4\x04\x46\xb2\x84\xe9\xc3\x7c\x6b\x8c\x9c\
|
||||
\xc4\xc4\x8e\xc7\x72\x5b\x21\x63\x30\x5d\xa6\x43\xda\x61\xb6\x0c\
|
||||
\xc7\xcc\x8b\x18\x94\xa0\x14\xa6\xde\x9a\xb8\xcd\xb3\x61\x08\x01\
|
||||
\x8b\x29\x57\xb5\x59\xbb\xcf\x9a\xa7\x95\x0f\x9c\x6b\x31\x8e\xe9\
|
||||
\x94\xc5\x59\x5c\xe3\x9b\xaf\x46\xf7\x8d\xf9\x1d\x1d\x57\x7f\xbe\
|
||||
\xe7\xa8\x6b\xcb\xba\xa3\x3c\x83\x66\x49\xed\xa7\x93\xb2\x46\x6c\
|
||||
\xb6\x51\xd9\xba\x45\xcf\x79\xc5\x3e\x38\x1b\x5f\x32\x1b\x31\x59\
|
||||
\x0b\x84\x76\x77\x26\x57\x05\x64\x0c\x72\xe8\x2c\xd4\x1c\x89\x16\
|
||||
\x91\x12\x10\x94\xdd\xaf\xfa\xe2\xe2\x9b\xe3\xe1\x7b\xb6\x6b\x55\
|
||||
\x50\xae\x5f\x07\x60\x3f\xe1\x23\x56\x0d\x4d\x26\xf5\x0d\xb1\x98\
|
||||
\x7f\x7e\xed\xe1\xe4\xb8\x72\x01\xc2\x10\xdc\xbd\x87\xd3\xe3\xca\
|
||||
\x15\x08\x2b\xbd\xc4\xa1\xae\x0a\x12\xed\x6c\x6b\x46\x2a\x59\xb2\
|
||||
\x64\x46\x97\x02\x42\x18\xd1\x8c\x6b\xe2\x2e\x31\x74\x5a\xe7\x2d\
|
||||
\x92\xdf\x46\xe8\xb4\xda\xed\x96\xd9\x37\xfb\x29\x9b\xc6\x34\x1d\
|
||||
\x65\x89\x3d\x3b\xee\xfe\xd3\xb7\xed\x1e\x6e\xd8\x3f\x63\x88\x18\
|
||||
\x60\x1c\x09\x00\x75\xa9\x8e\x32\xf7\x51\x6c\x0d\x91\x4b\x54\x56\
|
||||
\x93\x72\x4f\xae\x65\xe9\xce\x4a\xa9\xc2\x29\xee\xa9\x98\xf5\x98\
|
||||
\x62\x08\x0c\x55\xd7\xdd\x51\xc1\xd5\x70\x1d\x07\xb9\xa9\x28\x96\
|
||||
\xf7\x86\x83\x67\x18\xe4\x97\x56\x8e\x22\x63\x38\x4b\xb0\x06\xa8\
|
||||
\xcb\xbd\x5f\x91\x5a\xb9\xd5\xa8\xcc\xb2\xc6\xab\xb4\x32\xdc\x72\
|
||||
\xcd\xd5\xf6\x6a\xcd\xcf\x52\x9b\x0d\x54\x50\x9f\x45\x99\xf9\xc6\
|
||||
\xb1\x59\x99\x82\xfa\x2c\xca\x54\xf2\x74\xb3\x46\xb5\x21\xdb\xab\
|
||||
\x55\xed\xb0\xd7\xaa\x30\x83\x5a\x7f\x50\xd6\x73\x02\x91\x24\x90\
|
||||
\x7f\x71\xc1\xb6\xef\x65\xac\x7b\xf0\x2f\x2f\x6f\x4a\x64\
|
||||
\x00\x00\x0a\xde\
|
||||
\x00\
|
||||
\x00\x64\x81\x78\x9c\xed\x5c\xeb\x6f\xdb\xc8\x11\xff\xee\xbf\x82\
|
||||
|
@ -35521,52 +35535,52 @@ qt_resource_struct = "\
|
|||
\x00\x00\x01\x14\x00\x00\x00\x00\x00\x01\x00\x02\x52\xbc\
|
||||
\x00\x00\x00\xe0\x00\x00\x00\x00\x00\x01\x00\x01\xbc\xaa\
|
||||
\x00\x00\x02\x3e\x00\x00\x00\x00\x00\x01\x00\x05\x84\xf1\
|
||||
\x00\x00\x06\x7a\x00\x01\x00\x00\x00\x01\x00\x07\x8e\xc3\
|
||||
\x00\x00\x09\x66\x00\x01\x00\x00\x00\x01\x00\x08\x48\xa1\
|
||||
\x00\x00\x09\x46\x00\x00\x00\x00\x00\x01\x00\x08\x34\xdf\
|
||||
\x00\x00\x09\xfa\x00\x00\x00\x00\x00\x01\x00\x08\x62\x81\
|
||||
\x00\x00\x09\x18\x00\x01\x00\x00\x00\x01\x00\x08\x2d\xfe\
|
||||
\x00\x00\x04\x7c\x00\x01\x00\x00\x00\x01\x00\x07\x0c\xee\
|
||||
\x00\x00\x04\xaa\x00\x01\x00\x00\x00\x01\x00\x07\x13\xc3\
|
||||
\x00\x00\x05\x3a\x00\x01\x00\x00\x00\x01\x00\x07\x33\x01\
|
||||
\x00\x00\x08\xa8\x00\x01\x00\x00\x00\x01\x00\x08\x18\x06\
|
||||
\x00\x00\x08\x0c\x00\x01\x00\x00\x00\x01\x00\x07\xea\xbc\
|
||||
\x00\x00\x05\x68\x00\x00\x00\x00\x00\x01\x00\x07\x3c\x59\
|
||||
\x00\x00\x07\x2e\x00\x01\x00\x00\x00\x01\x00\x07\xaa\x8c\
|
||||
\x00\x00\x04\xce\x00\x01\x00\x00\x00\x01\x00\x07\x1c\x66\
|
||||
\x00\x00\x05\x94\x00\x00\x00\x00\x00\x01\x00\x07\x4e\x28\
|
||||
\x00\x00\x06\x5a\x00\x01\x00\x00\x00\x01\x00\x07\x86\xfb\
|
||||
\x00\x00\x08\xf6\x00\x01\x00\x00\x00\x01\x00\x08\x25\x05\
|
||||
\x00\x00\x07\x5a\x00\x01\x00\x00\x00\x01\x00\x07\xb1\x4f\
|
||||
\x00\x00\x09\xbe\x00\x01\x00\x00\x00\x01\x00\x08\x58\xce\
|
||||
\x00\x00\x04\xf0\x00\x01\x00\x00\x00\x01\x00\x07\x25\x54\
|
||||
\x00\x00\x0a\x34\x00\x01\x00\x00\x00\x01\x00\x08\x70\xf0\
|
||||
\x00\x00\x05\xe6\x00\x01\x00\x00\x00\x01\x00\x07\x65\x58\
|
||||
\x00\x00\x08\x88\x00\x01\x00\x00\x00\x01\x00\x08\x0f\x98\
|
||||
\x00\x00\x07\x00\x00\x01\x00\x00\x00\x01\x00\x07\xa5\x3c\
|
||||
\x00\x00\x07\xb0\x00\x01\x00\x00\x00\x01\x00\x07\xce\x7c\
|
||||
\x00\x00\x0a\x58\x00\x00\x00\x00\x00\x01\x00\x08\x7b\x1f\
|
||||
\x00\x00\x04\x54\x00\x01\x00\x00\x00\x01\x00\x07\x04\x89\
|
||||
\x00\x00\x05\xc4\x00\x01\x00\x00\x00\x01\x00\x07\x5d\x96\
|
||||
\x00\x00\x09\x90\x00\x01\x00\x00\x00\x01\x00\x08\x50\xe6\
|
||||
\x00\x00\x07\x86\x00\x00\x00\x00\x00\x01\x00\x07\xbc\x79\
|
||||
\x00\x00\x08\xcc\x00\x01\x00\x00\x00\x01\x00\x08\x1d\x1d\
|
||||
\x00\x00\x06\xd4\x00\x01\x00\x00\x00\x01\x00\x07\x9c\xc2\
|
||||
\x00\x00\x08\x3e\x00\x01\x00\x00\x00\x01\x00\x07\xf2\xfe\
|
||||
\x00\x00\x06\x2e\x00\x01\x00\x00\x00\x01\x00\x07\x7d\xfc\
|
||||
\x00\x00\x05\x1a\x00\x01\x00\x00\x00\x01\x00\x07\x2c\xe9\
|
||||
\x00\x00\x07\xd2\x00\x00\x00\x00\x00\x01\x00\x07\xd9\x47\
|
||||
\x00\x00\x08\x5e\x00\x00\x00\x00\x00\x01\x00\x07\xfd\x38\
|
||||
\x00\x00\x06\x10\x00\x00\x00\x00\x00\x01\x00\x07\x6f\x00\
|
||||
\x00\x00\x06\xa0\x00\x01\x00\x00\x00\x01\x00\x07\x95\x72\
|
||||
\x00\x00\x04\x1e\x00\x01\x00\x00\x00\x01\x00\x06\xfa\x8d\
|
||||
\x00\x00\x06\x7a\x00\x01\x00\x00\x00\x01\x00\x07\x8f\xa3\
|
||||
\x00\x00\x09\x66\x00\x01\x00\x00\x00\x01\x00\x08\x49\x81\
|
||||
\x00\x00\x09\x46\x00\x00\x00\x00\x00\x01\x00\x08\x35\xbf\
|
||||
\x00\x00\x09\xfa\x00\x00\x00\x00\x00\x01\x00\x08\x63\x61\
|
||||
\x00\x00\x09\x18\x00\x01\x00\x00\x00\x01\x00\x08\x2e\xde\
|
||||
\x00\x00\x04\x7c\x00\x01\x00\x00\x00\x01\x00\x07\x0d\xce\
|
||||
\x00\x00\x04\xaa\x00\x01\x00\x00\x00\x01\x00\x07\x14\xa3\
|
||||
\x00\x00\x05\x3a\x00\x01\x00\x00\x00\x01\x00\x07\x33\xe1\
|
||||
\x00\x00\x08\xa8\x00\x01\x00\x00\x00\x01\x00\x08\x18\xe6\
|
||||
\x00\x00\x08\x0c\x00\x01\x00\x00\x00\x01\x00\x07\xeb\x9c\
|
||||
\x00\x00\x05\x68\x00\x00\x00\x00\x00\x01\x00\x07\x3d\x39\
|
||||
\x00\x00\x07\x2e\x00\x01\x00\x00\x00\x01\x00\x07\xab\x6c\
|
||||
\x00\x00\x04\xce\x00\x01\x00\x00\x00\x01\x00\x07\x1d\x46\
|
||||
\x00\x00\x05\x94\x00\x00\x00\x00\x00\x01\x00\x07\x4f\x08\
|
||||
\x00\x00\x06\x5a\x00\x01\x00\x00\x00\x01\x00\x07\x87\xdb\
|
||||
\x00\x00\x08\xf6\x00\x01\x00\x00\x00\x01\x00\x08\x25\xe5\
|
||||
\x00\x00\x07\x5a\x00\x01\x00\x00\x00\x01\x00\x07\xb2\x2f\
|
||||
\x00\x00\x09\xbe\x00\x01\x00\x00\x00\x01\x00\x08\x59\xae\
|
||||
\x00\x00\x04\xf0\x00\x01\x00\x00\x00\x01\x00\x07\x26\x34\
|
||||
\x00\x00\x0a\x34\x00\x01\x00\x00\x00\x01\x00\x08\x71\xd0\
|
||||
\x00\x00\x05\xe6\x00\x01\x00\x00\x00\x01\x00\x07\x66\x38\
|
||||
\x00\x00\x08\x88\x00\x01\x00\x00\x00\x01\x00\x08\x10\x78\
|
||||
\x00\x00\x07\x00\x00\x01\x00\x00\x00\x01\x00\x07\xa6\x1c\
|
||||
\x00\x00\x07\xb0\x00\x01\x00\x00\x00\x01\x00\x07\xcf\x5c\
|
||||
\x00\x00\x0a\x58\x00\x00\x00\x00\x00\x01\x00\x08\x7b\xff\
|
||||
\x00\x00\x04\x54\x00\x01\x00\x00\x00\x01\x00\x07\x05\x69\
|
||||
\x00\x00\x05\xc4\x00\x01\x00\x00\x00\x01\x00\x07\x5e\x76\
|
||||
\x00\x00\x09\x90\x00\x01\x00\x00\x00\x01\x00\x08\x51\xc6\
|
||||
\x00\x00\x07\x86\x00\x00\x00\x00\x00\x01\x00\x07\xbd\x59\
|
||||
\x00\x00\x08\xcc\x00\x01\x00\x00\x00\x01\x00\x08\x1d\xfd\
|
||||
\x00\x00\x06\xd4\x00\x01\x00\x00\x00\x01\x00\x07\x9d\xa2\
|
||||
\x00\x00\x08\x3e\x00\x01\x00\x00\x00\x01\x00\x07\xf3\xde\
|
||||
\x00\x00\x06\x2e\x00\x01\x00\x00\x00\x01\x00\x07\x7e\xdc\
|
||||
\x00\x00\x05\x1a\x00\x01\x00\x00\x00\x01\x00\x07\x2d\xc9\
|
||||
\x00\x00\x07\xd2\x00\x00\x00\x00\x00\x01\x00\x07\xda\x27\
|
||||
\x00\x00\x08\x5e\x00\x00\x00\x00\x00\x01\x00\x07\xfe\x18\
|
||||
\x00\x00\x06\x10\x00\x00\x00\x00\x00\x01\x00\x07\x6f\xe0\
|
||||
\x00\x00\x06\xa0\x00\x01\x00\x00\x00\x01\x00\x07\x96\x52\
|
||||
\x00\x00\x04\x1e\x00\x01\x00\x00\x00\x01\x00\x06\xfb\x6d\
|
||||
\x00\x00\x02\xb2\x00\x01\x00\x00\x00\x01\x00\x06\xb6\xfd\
|
||||
\x00\x00\x03\x18\x00\x01\x00\x00\x00\x01\x00\x06\xc7\x42\
|
||||
\x00\x00\x03\xf6\x00\x01\x00\x00\x00\x01\x00\x06\xf1\xdd\
|
||||
\x00\x00\x02\xde\x00\x01\x00\x00\x00\x01\x00\x06\xbc\x60\
|
||||
\x00\x00\x03\x86\x00\x01\x00\x00\x00\x01\x00\x06\xdd\x03\
|
||||
\x00\x00\x03\x4c\x00\x01\x00\x00\x00\x01\x00\x06\xd2\x68\
|
||||
\x00\x00\x03\xbe\x00\x01\x00\x00\x00\x01\x00\x06\xe6\x8d\
|
||||
\x00\x00\x03\x18\x00\x01\x00\x00\x00\x01\x00\x06\xc8\x22\
|
||||
\x00\x00\x03\xf6\x00\x01\x00\x00\x00\x01\x00\x06\xf2\xbd\
|
||||
\x00\x00\x02\xde\x00\x01\x00\x00\x00\x01\x00\x06\xbd\x40\
|
||||
\x00\x00\x03\x86\x00\x01\x00\x00\x00\x01\x00\x06\xdd\xe3\
|
||||
\x00\x00\x03\x4c\x00\x01\x00\x00\x00\x01\x00\x06\xd3\x48\
|
||||
\x00\x00\x03\xbe\x00\x01\x00\x00\x00\x01\x00\x06\xe7\x6d\
|
||||
"
|
||||
|
||||
def qInitResources():
|
||||
|
|
|
@ -207,6 +207,48 @@
|
|||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox">
|
||||
<property name="title">
|
||||
<string>IFC export</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="text">
|
||||
<string>Scaling factor</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="Gui::PrefDoubleSpinBox" name="gui::prefdoublespinbox">
|
||||
<property name="toolTip">
|
||||
<string>IFC files are typically written in millimeters. If you are working in a different unit, this allow you to scale all your units to be expressed in millimeters.</string>
|
||||
</property>
|
||||
<property name="decimals">
|
||||
<number>4</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<double>99999.000000000000000</double>
|
||||
</property>
|
||||
<property name="value">
|
||||
<double>1.000000000000000</double>
|
||||
</property>
|
||||
<property name="prefEntry" stdset="0">
|
||||
<cstring>IfcScalingFactor</cstring>
|
||||
</property>
|
||||
<property name="prefPath" stdset="0">
|
||||
<cstring>Mod/Arch</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
|
@ -245,6 +287,11 @@
|
|||
<extends>QLineEdit</extends>
|
||||
<header>Gui/PrefWidgets.h</header>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>Gui::PrefDoubleSpinBox</class>
|
||||
<extends>QDoubleSpinBox</extends>
|
||||
<header>Gui/PrefWidgets.h</header>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources/>
|
||||
<connections/>
|
||||
|
|
|
@ -409,6 +409,25 @@ class IfcDocument(object):
|
|||
storey = self.addStorey()
|
||||
self._relate(storey,wal)
|
||||
return wal
|
||||
|
||||
def addStructure(self,ifctype,shapes,storey=None,placement=None,name="Default Structure",description=None):
|
||||
"""addWall(ifctype,shapes,[storey,placement,name,description]): creates a structure
|
||||
from the given representation shape(s). Ifctype is the type of structural object (IfcBeam, IfcColumn, etc)"""
|
||||
if not placement:
|
||||
placement = self.addPlacement()
|
||||
if not isinstance(shapes,list):
|
||||
shapes = [shapes]
|
||||
reps = [create(self._fileobject,"IfcShapeRepresentation",[self._repcontext,'Body','SweptSolid',[shape]],self._refs) for shape in shapes]
|
||||
prd = create(self._fileobject,"IfcProductDefinitionShape",[None,None,reps],self._refs)
|
||||
stt = create(self._fileobject,ifctype,[uid(),self._owner,name,description,None,placement,prd,None],self._refs)
|
||||
self.BuildingProducts.append(stt)
|
||||
if not storey:
|
||||
if self.Storeys:
|
||||
storey = self.Storeys[0]
|
||||
else:
|
||||
storey = self.addStorey()
|
||||
self._relate(storey,stt)
|
||||
return stt
|
||||
|
||||
def addPolyline(self,points):
|
||||
"""addPolyline(points): creates a polyline from the given points"""
|
||||
|
@ -446,10 +465,10 @@ class IfcDocument(object):
|
|||
loop = create(self._fileobject,"IfcPolyLoop",[pts],self._refs)
|
||||
fb = create(self._fileobject,"IfcFaceBound",[loop,True],self._refs)
|
||||
ifb.append(fb)
|
||||
print [ofb]+ifb
|
||||
print dir(ofb)
|
||||
for i in range(ofb.get_argument_count()):
|
||||
print i,": ",ofb.get_argument_name(i)
|
||||
#print [ofb]+ifb
|
||||
#print dir(ofb)
|
||||
#for i in range(ofb.get_argument_count()):
|
||||
# print i,": ",ofb.get_argument_name(i)
|
||||
# 0 : Bound, 1 : Orientation
|
||||
iface = create(self._fileobject,"IfcFace",[[ofb]+ifb],self._refs)
|
||||
return iface
|
||||
|
@ -465,28 +484,6 @@ class IfcDocument(object):
|
|||
|
||||
# EXAMPLES #################################################################
|
||||
|
||||
def example2():
|
||||
|
||||
"creation of a new file using advanced IfcDocument object"
|
||||
|
||||
ifc = IfcDocument("/home/yorik/test2.ifc")
|
||||
ifc.Name = "Test Project"
|
||||
ifc.Owner = "Yorik van Havre"
|
||||
ifc.Organization = "FreeCAD"
|
||||
ifc.addWall( ifc.addExtrudedPolyline([(0,0,0),(0,200,0),(5000,200,0),(5000,0,0),(0,0,0)], (0,0,3500)) )
|
||||
ifc.addWall( ifc.addExtrudedPolyline([(0,200,0),(0,2000,0),(200,2000,0),(200,200,0),(0,200,0)],(0,0,3500)) )
|
||||
ifc.addWall( ifc.addExtrudedPolyline([(0,2000,0),(0,2200,0),(5000,2200,0),(5000,2000,0),(0,2000,0)],(0,0,3500)) )
|
||||
ifc.addWall( ifc.addExtrudedPolyline([(5000,200,0),(5000,2000,0),(4800,2000,0),(4800,200,0),(5000,200,0)],(0,0,3500)) )
|
||||
ifc.addWall( ifc.addFacetedBrep([[[(0,0,0),(100,0,0),(100,-1000,0),(0,-1000,0)]],
|
||||
[[(0,0,0),(100,0,0),(100,0,1000),(0,0,1000)]],
|
||||
[[(0,0,0),(0,0,1000),(0,-1000,1000),(0,-1000,0)]],
|
||||
[[(0,-1000,0),(0,-1000,1000),(100,-1000,1000),(100,-1000,0)]],
|
||||
[[(100,-1000,0),(100,-1000,1000),(100,0,1000),(100,0,0)]],
|
||||
[[(0,0,1000),(0,-1000,1000),(100,-1000,1000),(100,0,1000)]]]) )
|
||||
ifc.write()
|
||||
|
||||
print ifc
|
||||
|
||||
def example1():
|
||||
|
||||
"creation of a new file using manual, step-by-step procedure"
|
||||
|
@ -520,4 +517,25 @@ def example1():
|
|||
print w
|
||||
print dir(w)
|
||||
print w.is_a("IfcWallStandardCase")
|
||||
|
||||
def example2():
|
||||
|
||||
"creation of a new file using advanced IfcDocument object"
|
||||
|
||||
ifc = IfcDocument("/home/yorik/test2.ifc")
|
||||
ifc.Name = "Test Project"
|
||||
ifc.Owner = "Yorik van Havre"
|
||||
ifc.Organization = "FreeCAD"
|
||||
ifc.addWall( ifc.addExtrudedPolyline([(0,0,0),(0,200,0),(5000,200,0),(5000,0,0),(0,0,0)], (0,0,3500)) )
|
||||
ifc.addWall( ifc.addExtrudedPolyline([(0,200,0),(0,2000,0),(200,2000,0),(200,200,0),(0,200,0)],(0,0,3500)) )
|
||||
ifc.addWall( ifc.addExtrudedPolyline([(0,2000,0),(0,2200,0),(5000,2200,0),(5000,2000,0),(0,2000,0)],(0,0,3500)) )
|
||||
ifc.addWall( ifc.addExtrudedPolyline([(5000,200,0),(5000,2000,0),(4800,2000,0),(4800,200,0),(5000,200,0)],(0,0,3500)) )
|
||||
ifc.addWall( ifc.addFacetedBrep([[[(0,0,0),(100,0,0),(100,-1000,0),(0,-1000,0)]],
|
||||
[[(0,0,0),(100,0,0),(100,0,1000),(0,0,1000)]],
|
||||
[[(0,0,0),(0,0,1000),(0,-1000,1000),(0,-1000,0)]],
|
||||
[[(0,-1000,0),(0,-1000,1000),(100,-1000,1000),(100,-1000,0)]],
|
||||
[[(100,-1000,0),(100,-1000,1000),(100,0,1000),(100,0,0)]],
|
||||
[[(0,0,1000),(0,-1000,1000),(100,-1000,1000),(100,0,1000)]]]) )
|
||||
ifc.addStructure( "IfcColumn", ifc.addExtrudedPolyline([(0,0,0),(0,-200,0),(-500,-200,0),(-500,0,0),(0,0,0)], (0,0,3500)) )
|
||||
ifc.write()
|
||||
|
||||
|
|
|
@ -740,6 +740,9 @@ def export(exportList,filename):
|
|||
return
|
||||
|
||||
import Arch,Draft
|
||||
ifcWriter.PRECISION = Draft.precision()
|
||||
p = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Arch")
|
||||
scaling = p.GetFloat("IfcScalingFactor",1.0)
|
||||
application = "FreeCAD"
|
||||
ver = FreeCAD.Version()
|
||||
version = ver[0]+"."+ver[1]+" build"+ver[2]
|
||||
|
@ -747,23 +750,41 @@ def export(exportList,filename):
|
|||
company = FreeCAD.ActiveDocument.Company
|
||||
project = FreeCAD.ActiveDocument.Name
|
||||
ifc = ifcWriter.IfcDocument(filename,project,owner,company,application,version)
|
||||
print "opened ",ifc
|
||||
|
||||
for obj in exportList:
|
||||
otype = Draft.getType(obj)
|
||||
gdata = Arch.getExtrusionData(obj)
|
||||
if not data:
|
||||
fdata = Arch.getBrepFacesData(obj)
|
||||
name = obj.Name
|
||||
gdata = Arch.getExtrusionData(obj,scaling)
|
||||
if not gdata:
|
||||
fdata = Arch.getBrepFacesData(obj,scaling)
|
||||
if not fdata:
|
||||
print "IFC export: error retrieving the shape of object ", obj.Name
|
||||
continue
|
||||
|
||||
if otype == "Wall":
|
||||
if gdata:
|
||||
ifc.addWall( ifc.addExtrudedPolyline(gdata) )
|
||||
ifc.addWall( ifc.addExtrudedPolyline(gdata[0],gdata[1]), name )
|
||||
elif fdata:
|
||||
ifc.addWall( ifc.addFacetedBrep(fdata) )
|
||||
else:
|
||||
print "IFC export: error retrieving the shape of object ", obj.Name
|
||||
ifc.addWall( ifc.addFacetedBrep(fdata), name )
|
||||
|
||||
|
||||
elif otype == "Structure":
|
||||
role = "IfcBeam"
|
||||
if hasattr(obj,"Role"):
|
||||
if obj.Role == "Column":
|
||||
role = "IfcColumn"
|
||||
elif obj.Role == "Slab":
|
||||
role = "IfcSlab"
|
||||
elif obj.Role == "Foundation":
|
||||
role = "IfcFooting"
|
||||
if gdata:
|
||||
ifc.addStructure( role, ifc.addExtrudedPolyline(gdata[0],gdata[1]), name )
|
||||
elif fdata:
|
||||
ifc.addStructure( role, ifc.addFacetedBrep(fdata), name )
|
||||
|
||||
else:
|
||||
print "object type ", otype, " is not supported yet."
|
||||
print "IFC export: object type ", otype, " is not supported yet."
|
||||
|
||||
ifc.write()
|
||||
print "Successfully exported ",filename
|
||||
|
|
Loading…
Reference in New Issue
Block a user