Merge branch 'main' into bim-cleanup-license
This commit is contained in:
@@ -24,9 +24,9 @@
|
||||
|
||||
"""This module contains IFC-related FreeCAD commands"""
|
||||
|
||||
|
||||
import FreeCAD
|
||||
import FreeCADGui
|
||||
|
||||
from . import ifc_openshell
|
||||
|
||||
translate = FreeCAD.Qt.translate
|
||||
@@ -157,7 +157,7 @@ class IFC_MakeProject:
|
||||
def Activated(self):
|
||||
from importers import exportIFC # lazy loading
|
||||
from . import ifc_tools
|
||||
from PySide import QtCore, QtGui
|
||||
from PySide import QtGui
|
||||
|
||||
doc = FreeCAD.ActiveDocument
|
||||
objs = FreeCADGui.Selection.getSelection()
|
||||
|
||||
@@ -25,12 +25,15 @@
|
||||
"""Diffing tool for NativeIFC project objects"""
|
||||
|
||||
import difflib
|
||||
|
||||
import ifcopenshell
|
||||
|
||||
import FreeCAD
|
||||
import FreeCADGui
|
||||
import ifcopenshell
|
||||
from . import ifc_tools
|
||||
import Arch_rc
|
||||
|
||||
from . import ifc_tools
|
||||
|
||||
translate = FreeCAD.Qt.translate
|
||||
|
||||
|
||||
|
||||
@@ -24,9 +24,10 @@
|
||||
|
||||
import tempfile
|
||||
|
||||
import ifcopenshell
|
||||
|
||||
import FreeCAD
|
||||
import Draft
|
||||
import ifcopenshell
|
||||
|
||||
from importers import exportIFC
|
||||
from importers import exportIFCHelper
|
||||
|
||||
@@ -26,25 +26,24 @@
|
||||
The only entry point in this module is the generate_geometry() function which is
|
||||
used by the execute() method of ifc_objects"""
|
||||
|
||||
|
||||
import multiprocessing
|
||||
import re
|
||||
import FreeCAD
|
||||
from FreeCAD import Base
|
||||
import Part
|
||||
|
||||
import ifcopenshell
|
||||
import ifcopenshell.util.element
|
||||
|
||||
import multiprocessing
|
||||
|
||||
import FreeCADGui
|
||||
|
||||
from pivy import coin
|
||||
from PySide import QtCore
|
||||
|
||||
import FreeCAD
|
||||
import FreeCADGui
|
||||
import Part
|
||||
|
||||
from FreeCAD import Base
|
||||
|
||||
from . import ifc_tools
|
||||
from . import ifc_export
|
||||
|
||||
|
||||
def generate_geometry(obj, cached=False):
|
||||
"""Sets the geometry of the given object from a corresponding IFC element.
|
||||
This is the main function called by the execute method of FreeCAD document objects
|
||||
|
||||
@@ -24,11 +24,11 @@
|
||||
|
||||
"""This module contains geometry editing and geometry properties-related tools"""
|
||||
|
||||
import FreeCAD
|
||||
|
||||
import ifcopenshell
|
||||
import ifcopenshell.util.unit
|
||||
|
||||
import FreeCAD
|
||||
|
||||
from . import ifc_tools
|
||||
|
||||
|
||||
|
||||
@@ -24,12 +24,12 @@
|
||||
|
||||
"""This NativeIFC module deals with layers"""
|
||||
|
||||
|
||||
import ifcopenshell
|
||||
import ifcopenshell.util.element
|
||||
|
||||
from . import ifc_tools
|
||||
|
||||
|
||||
def load_layers(obj):
|
||||
"""Loads all the layers of an IFC file"""
|
||||
|
||||
|
||||
@@ -24,13 +24,14 @@
|
||||
|
||||
"""This NativeIFC module deals with materials"""
|
||||
|
||||
import FreeCAD
|
||||
|
||||
import ifcopenshell
|
||||
import ifcopenshell.util.element
|
||||
|
||||
import FreeCAD
|
||||
|
||||
from . import ifc_tools
|
||||
|
||||
|
||||
def create_material(element, parent, recursive=False):
|
||||
"""Creates a material object in the given project or parent material"""
|
||||
|
||||
|
||||
@@ -26,12 +26,15 @@
|
||||
|
||||
import FreeCAD
|
||||
import FreeCADGui
|
||||
|
||||
translate = FreeCAD.Qt.translate
|
||||
|
||||
|
||||
# the property groups below should not be treated as psets
|
||||
NON_PSETS = ["Base", "IFC", "", "Geometry", "Dimension", "Linear/radial dimension",
|
||||
"SectionPlane", "Axis", "PhysicalProperties", "BuildingPart", "IFC Attributes"]
|
||||
|
||||
|
||||
class ifc_object:
|
||||
"""Base class for all IFC-based objects"""
|
||||
|
||||
|
||||
@@ -24,9 +24,9 @@
|
||||
|
||||
"""Document observer to act on documents containing NativeIFC objects"""
|
||||
|
||||
|
||||
import FreeCAD
|
||||
|
||||
|
||||
params = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/NativeIFC")
|
||||
|
||||
|
||||
|
||||
@@ -26,9 +26,10 @@
|
||||
|
||||
"""Utilities to help people verify and update their version of ifcopenshell"""
|
||||
|
||||
from packaging.version import Version
|
||||
|
||||
import FreeCAD
|
||||
import FreeCADGui
|
||||
from packaging.version import Version
|
||||
from addonmanager_utilities import create_pip_call
|
||||
|
||||
translate = FreeCAD.Qt.translate
|
||||
|
||||
@@ -24,8 +24,10 @@
|
||||
|
||||
import os
|
||||
import time
|
||||
import FreeCAD
|
||||
import unittest
|
||||
|
||||
import FreeCAD
|
||||
|
||||
from . import ifc_import
|
||||
|
||||
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
|
||||
"""This NativeIFC module deals with properties and property sets"""
|
||||
|
||||
|
||||
import os
|
||||
import re
|
||||
|
||||
|
||||
@@ -24,13 +24,18 @@
|
||||
|
||||
"""Unit test for the Native IFC module"""
|
||||
|
||||
import difflib
|
||||
import os
|
||||
import time
|
||||
import tempfile
|
||||
import FreeCAD
|
||||
import Draft
|
||||
import Arch
|
||||
import unittest
|
||||
|
||||
import ifcopenshell
|
||||
from ifcopenshell.util import element
|
||||
|
||||
import FreeCAD
|
||||
import Arch
|
||||
import Draft
|
||||
|
||||
from . import ifc_import
|
||||
from . import ifc_tools
|
||||
from . import ifc_geometry
|
||||
@@ -39,9 +44,7 @@ from . import ifc_layers
|
||||
from . import ifc_psets
|
||||
from . import ifc_objects
|
||||
from . import ifc_generator
|
||||
import ifcopenshell
|
||||
from ifcopenshell.util import element
|
||||
import difflib
|
||||
|
||||
|
||||
IFC_FILE_PATH = None # downloaded IFC file path
|
||||
FCSTD_FILE_PATH = None # saved FreeCAD file
|
||||
|
||||
@@ -26,13 +26,12 @@
|
||||
|
||||
"""This contains nativeifc status widgets and functionality"""
|
||||
|
||||
|
||||
import os
|
||||
import csv
|
||||
import os
|
||||
|
||||
import FreeCAD
|
||||
import FreeCADGui
|
||||
|
||||
|
||||
translate = FreeCAD.Qt.translate
|
||||
params = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/NativeIFC")
|
||||
text_on = translate("BIM", "Strict IFC mode is ON (all objects are IFC)")
|
||||
@@ -103,7 +102,7 @@ def on_add_property():
|
||||
sel = FreeCADGui.Selection.getSelection()
|
||||
if not sel:
|
||||
return
|
||||
from PySide import QtCore, QtGui # lazy loading
|
||||
from PySide import QtGui # lazy loading
|
||||
from . import ifc_psets
|
||||
obj = sel[0]
|
||||
psets = list(set([obj.getGroupOfProperty(p) for p in obj.PropertiesList]))
|
||||
@@ -182,7 +181,6 @@ def on_add_pset():
|
||||
sel = FreeCADGui.Selection.getSelection()
|
||||
if not sel:
|
||||
return
|
||||
from PySide import QtCore, QtGui # lazy loading
|
||||
from . import ifc_psets
|
||||
obj = sel[0]
|
||||
mw = FreeCADGui.getMainWindow()
|
||||
@@ -276,7 +274,7 @@ def on_new():
|
||||
def set_menu(locked=False):
|
||||
"""Sets the File menu items"""
|
||||
|
||||
from PySide import QtCore, QtGui # lazy loading
|
||||
from PySide import QtGui # lazy loading
|
||||
|
||||
# switch Std_Save and IFC_Save
|
||||
mw = FreeCADGui.getMainWindow()
|
||||
@@ -455,7 +453,6 @@ def lock_document():
|
||||
def find_toplevel(objs):
|
||||
"""Finds the top-level objects from the list"""
|
||||
|
||||
import Draft
|
||||
# filter out any object that depend on another from the list
|
||||
nobjs = []
|
||||
for obj in objs:
|
||||
@@ -477,6 +474,8 @@ def find_toplevel(objs):
|
||||
def filter_out(objs):
|
||||
"""Filter out objects that should not be converted to IFC"""
|
||||
|
||||
import Draft
|
||||
|
||||
nobjs = []
|
||||
for obj in objs:
|
||||
if obj.isDerivedFrom("Part::Feature"):
|
||||
|
||||
@@ -25,9 +25,15 @@
|
||||
"""This is the main NativeIFC module"""
|
||||
|
||||
import os
|
||||
|
||||
from PySide import QtCore
|
||||
|
||||
import FreeCAD
|
||||
import Draft
|
||||
import Arch
|
||||
import ArchBuildingPart
|
||||
import Draft
|
||||
|
||||
from draftviewproviders import view_layer
|
||||
|
||||
translate = FreeCAD.Qt.translate
|
||||
|
||||
@@ -61,10 +67,6 @@ from . import ifc_status
|
||||
from . import ifc_export
|
||||
from . import ifc_psets
|
||||
|
||||
from draftviewproviders import view_layer
|
||||
import ArchBuildingPart
|
||||
from PySide import QtCore
|
||||
|
||||
SCALE = 1000.0 # IfcOpenShell works in meters, FreeCAD works in mm
|
||||
SHORT = False # If True, only Step ID attribute is created
|
||||
ROUND = 8 # rounding value for placements
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
|
||||
"""This NativeIFC module handles the retrieval and display of geometry compositions of objects"""
|
||||
|
||||
|
||||
import FreeCAD
|
||||
|
||||
TAB = 2
|
||||
@@ -82,7 +81,7 @@ def show_geometry_tree(element):
|
||||
import Arch_rc
|
||||
import FreeCADGui # lazy import
|
||||
from . import ifc_tools
|
||||
from PySide import QtGui, QtWidgets
|
||||
from PySide import QtWidgets
|
||||
|
||||
if isinstance(element, FreeCAD.DocumentObject):
|
||||
element = ifc_tools.get_ifc_element(element)
|
||||
@@ -149,7 +148,7 @@ def show_properties(current, previous):
|
||||
|
||||
import FreeCADGui
|
||||
from . import ifc_tools # lazy loading
|
||||
from PySide import QtCore, QtGui, QtWidgets
|
||||
from PySide import QtCore, QtWidgets
|
||||
|
||||
ifcid = int(current.text(0).split("=", 1)[0].strip(" ").strip("#"))
|
||||
sel = FreeCADGui.Selection.getSelection()
|
||||
|
||||
@@ -24,8 +24,8 @@
|
||||
|
||||
"""Diffing tool for NativeIFC project objects"""
|
||||
|
||||
|
||||
import FreeCAD
|
||||
|
||||
from . import ifc_tools
|
||||
|
||||
translate = FreeCAD.Qt.translate
|
||||
|
||||
@@ -88,7 +88,7 @@ class ifc_vp_object:
|
||||
from . import ifc_psets
|
||||
from . import ifc_materials
|
||||
from . import ifc_types
|
||||
from PySide import QtCore, QtGui # lazy import
|
||||
from PySide import QtGui # lazy import
|
||||
|
||||
if FreeCADGui.activeWorkbench().name() != 'BIMWorkbench':
|
||||
return
|
||||
@@ -421,7 +421,7 @@ class ifc_vp_document(ifc_vp_object):
|
||||
|
||||
def setupContextMenu(self, vobj, menu):
|
||||
|
||||
from PySide import QtCore, QtGui # lazy import
|
||||
from PySide import QtGui # lazy import
|
||||
|
||||
if FreeCADGui.activeWorkbench().name() != 'BIMWorkbench':
|
||||
return
|
||||
@@ -465,7 +465,7 @@ class ifc_vp_document(ifc_vp_object):
|
||||
def replace_file(self, obj, newfile):
|
||||
"""Asks the user if the attached file path needs to be replaced"""
|
||||
|
||||
from PySide import QtCore, QtGui # lazy import
|
||||
from PySide import QtGui # lazy import
|
||||
|
||||
msg = "Replace the stored IFC file path in object "
|
||||
msg += self.Object.Label + " with the new one: "
|
||||
@@ -486,7 +486,7 @@ class ifc_vp_document(ifc_vp_object):
|
||||
return False
|
||||
|
||||
def schema_warning(self):
|
||||
from PySide import QtCore, QtGui # lazy import
|
||||
from PySide import QtGui # lazy import
|
||||
|
||||
msg = "Warning: This operation will change the whole IFC file contents "
|
||||
msg += "and will not give versionable results. It is best to not do "
|
||||
@@ -518,7 +518,7 @@ class ifc_vp_group:
|
||||
self.Object = vobj.Object
|
||||
|
||||
def getIcon(self):
|
||||
from PySide import QtCore, QtGui # lazy loading
|
||||
from PySide import QtGui # lazy loading
|
||||
import Draft_rc
|
||||
import Arch_rc
|
||||
|
||||
@@ -604,7 +604,7 @@ class ifc_vp_material:
|
||||
def setupContextMenu(self, vobj, menu):
|
||||
from . import ifc_tools # lazy import
|
||||
from . import ifc_psets
|
||||
from PySide import QtCore, QtGui # lazy import
|
||||
from PySide import QtGui # lazy import
|
||||
|
||||
if FreeCADGui.activeWorkbench().name() != 'BIMWorkbench':
|
||||
return
|
||||
@@ -662,7 +662,7 @@ def get_filepath(project):
|
||||
"""Saves the associated IFC file to another file"""
|
||||
|
||||
from . import ifc_tools # lazy import
|
||||
from PySide import QtCore, QtGui # lazy import
|
||||
from PySide import QtGui # lazy import
|
||||
|
||||
sf = QtGui.QFileDialog.getSaveFileName(
|
||||
None,
|
||||
|
||||
Reference in New Issue
Block a user