importIFC Namespace Reference

IFC file format importer and exporter. More...

Functions

def createCurve (ifcfile, wire)
 
def decode (filename, utf=False)
 
def doubleClickTree (item, column)
 
def explore (filename=None)
 
def export (exportList, filename)
 
def getPlacement (entity, scaling=1000)
 
def getPreferences ()
 
def getProfile (ifcfile, p)
 
def getRepresentation (ifcfile, context, obj, forcebrep=False, subtraction=False, tessellation=1)
 
def getRotation (entity)
 
def getScaling (ifcfile)
 
def getVector (entity, scaling=1000)
 
def insert (filename, docname, skip=[], only=[], root=None)
 
def open (filename, skip=[], only=[], root=None)
 
def setRepresentation (representation, scaling=1000)
 

Variables

bool DEBUG = False
 
string ifctemplate
 
 pyopen = open
 
tuple structuralifcobjects
 
dictionary translationtable
 
dictionary typesmap
 

Detailed Description

IFC file format importer and exporter.

This module provides tools to import and export IFC files.

Function Documentation

def importIFC.createCurve (   ifcfile,
  wire 
)
def importIFC.decode (   filename,
  utf = False 
)

Referenced by explore(), export(), insert(), and open().

def importIFC.doubleClickTree (   item,
  column 
)
def importIFC.explore (   filename = None)
explore([filename]): opens a dialog showing
the contents of an IFC file. If no filename is given, a dialog will
pop up to choose a file.

References decode(), and getPreferences().

Referenced by ArchCommands.printWarning().

def importIFC.getPlacement (   entity,
  scaling = 1000 
)
def importIFC.getPreferences ( )
retrieves IFC preferences

Referenced by explore(), export(), and insert().

def importIFC.getProfile (   ifcfile,
  p 
)
returns an IFC profile definition from a shape

References createCurve(), and DraftGeomUtils.hasCurves().

Referenced by getRepresentation().

def importIFC.getRepresentation (   ifcfile,
  context,
  obj,
  forcebrep = False,
  subtraction = False,
  tessellation = 1 
)
def importIFC.getRotation (   entity)

Referenced by insert(), and setRepresentation().

def importIFC.getScaling (   ifcfile)

Referenced by insert().

def importIFC.getVector (   entity,
  scaling = 1000 
)

Referenced by getPlacement().

def importIFC.insert (   filename,
  docname,
  skip = [],
  only = [],
  root = None 
)
insert(filename,docname,skip=[],only=[],root=None): imports the contents of an IFC file.
skip can contain a list of ids of objects to be skipped, only can restrict the import to
certain object ids (will also get their children) and root can be used to
import only the derivates of a certain element type (default = ifcProduct).

References decode(), getPlacement(), getPreferences(), getRotation(), getScaling(), Draft.getType(), and setRepresentation().

Referenced by open().

def importIFC.open (   filename,
  skip = [],
  only = [],
  root = None 
)

References decode(), and insert().

def importIFC.setRepresentation (   representation,
  scaling = 1000 
)
Returns a shape from a 2D IfcShapeRepresentation

References DraftVecUtils.angle(), getPlacement(), and getRotation().

Referenced by insert().

Variable Documentation

bool importIFC.DEBUG = False
string importIFC.ifctemplate
Initial value:
1 = """ISO-10303-21;
2 HEADER;
3 FILE_DESCRIPTION(('ViewDefinition [CoordinationView]'),'2;1');
4 FILE_NAME('$filename','$timestamp',('$owner','$email'),('$company'),'IfcOpenShell','IfcOpenShell','');
5 FILE_SCHEMA(('$ifcschema'));
6 ENDSEC;
7 DATA;
8 #1=IFCPERSON($,$,'$owner',$,$,$,$,$);
9 #2=IFCORGANIZATION($,'$company',$,$,$);
10 #3=IFCPERSONANDORGANIZATION(#1,#2,$);
11 #4=IFCAPPLICATION(#2,'$version','FreeCAD','118df2cf_ed21_438e_a41');
12 #5=IFCOWNERHISTORY(#3,#4,$,.ADDED.,$,#3,#4,$now);
13 #6=IFCDIRECTION((1.,0.,0.));
14 #7=IFCDIRECTION((0.,0.,1.));
15 #8=IFCCARTESIANPOINT((0.,0.,0.));
16 #9=IFCAXIS2PLACEMENT3D(#8,#7,#6);
17 #10=IFCDIRECTION((0.,1.,0.));
18 #11=IFCGEOMETRICREPRESENTATIONCONTEXT('Plan','Model',3,1.E-05,#9,#10);
19 #12=IFCDIMENSIONALEXPONENTS(0,0,0,0,0,0,0);
20 #13=IFCSIUNIT(*,.LENGTHUNIT.,$,.METRE.);
21 #14=IFCSIUNIT(*,.AREAUNIT.,$,.SQUARE_METRE.);
22 #15=IFCSIUNIT(*,.VOLUMEUNIT.,$,.CUBIC_METRE.);
23 #16=IFCSIUNIT(*,.PLANEANGLEUNIT.,$,.RADIAN.);
24 #17=IFCMEASUREWITHUNIT(IFCPLANEANGLEMEASURE(0.017453292519943295),#16);
25 #18=IFCCONVERSIONBASEDUNIT(#12,.PLANEANGLEUNIT.,'DEGREE',#17);
26 #19=IFCUNITASSIGNMENT((#13,#14,#15,#18));
27 #20=IFCPROJECT('$projectid',#5,'$project',$,$,$,$,(#11),#19);
28 ENDSEC;
29 END-ISO-10303-21;
30 """
importIFC.pyopen = open

Referenced by export().

tuple importIFC.structuralifcobjects
Initial value:
1 = (
2  "IfcStructuralCurveMember", "IfcStructuralSurfaceMember",
3  "IfcStructuralPointConnection", "IfcStructuralCurveConnection", "IfcStructuralSurfaceConnection",
4  "IfcStructuralAction", "IfcStructuralPointAction",
5  "IfcStructuralLinearAction", "IfcStructuralLinearActionVarying", "IfcStructuralPlanarAction"
6  )
dictionary importIFC.translationtable
Initial value:
1 = { "Foundation":"Footing",
2  "Floor":"BuildingStorey",
3  "Rebar":"ReinforcingBar",
4  "HydroEquipment":"SanitaryTerminal",
5  "ElectricEquipment":"ElectricAppliance",
6  "Furniture":"FurnishingElement",
7  "Stair Flight":"StairFlight",
8  "Curtain Wall":"CurtainWall",
9  "Pipe Segment":"PipeSegment",
10  "Pipe Fitting":"PipeFitting"
11  }
dictionary importIFC.typesmap
Initial value:
1 = { "Site": ["IfcSite"],
2  "Building": ["IfcBuilding"],
3  "Floor": ["IfcBuildingStorey"],
4  "Structure": ["IfcBeam", "IfcBeamStandardCase", "IfcColumn", "IfcColumnStandardCase", "IfcSlab", "IfcFooting", "IfcPile", "IfcTendon"],
5  "Wall": ["IfcWall", "IfcWallStandardCase", "IfcCurtainWall"],
6  "Window": ["IfcWindow", "IfcWindowStandardCase", "IfcDoor", "IfcDoorStandardCase"],
7  "Roof": ["IfcRoof"],
8  "Stairs": ["IfcStair", "IfcStairFlight", "IfcRamp", "IfcRampFlight"],
9  "Space": ["IfcSpace"],
10  "Rebar": ["IfcReinforcingBar"],
11  "Panel": ["IfcPlate"],
12  "Equipment": ["IfcFurnishingElement","IfcSanitaryTerminal","IfcFlowTerminal","IfcElectricAppliance"],
13  "Pipe": ["IfcPipeSegment"],
14  "PipeConnector":["IfcPipeFitting"]
15  }