Added insert functions to Arch DAE and IFC importers

This commit is contained in:
Yorik van Havre 2012-04-27 17:59:15 -03:00
parent 4ca7d0c5f3
commit da43b9ecc2
2 changed files with 29 additions and 0 deletions

View File

@ -51,6 +51,17 @@ def open(filename):
read(filename)
return doc
def insert(filename,docname):
"called when freecad wants to import a file"
if not checkCollada(): return
try:
doc = FreeCAD.getDocument(docname)
except:
doc = FreeCAD.newDocument(docname)
FreeCAD.ActiveDocument = doc
read(filename)
return doc
def decode(name):
"decodes encoded strings"
try:

View File

@ -54,6 +54,24 @@ def open(filename):
read(filename)
return doc
def insert(filename,docname):
"called when freecad wants to import a file"
try:
doc = FreeCAD.getDocument(docname)
except:
doc = FreeCAD.newDocument(docname)
FreeCAD.ActiveDocument = doc
global createIfcGroups, useIfcOpenShell, importIfcFurniture
createIfcGroups = useIfcOpenShell = importIfcFurniture = False
p = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Arch")
useIfcOpenShell = p.GetBool("useIfcOpenShell")
createIfcGroups = p.GetBool("createIfcGroups")
importIfcFurniture = p.GetBool("importIfcFurniture")
if not importIfcFurniture:
SKIP.append("IfcFurnishingElement")
read(filename)
return doc
def decode(name):
"decodes encoded strings"
try: