mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-09 17:31:45 +00:00
See #3817. WARNING: fundamental change. Standardise prioritisation of all context permutations when loading occurrences and types.
This commit is contained in:
@@ -16,6 +16,8 @@
|
||||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with IfcOpenShell. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
import ifcopenshell
|
||||
|
||||
|
||||
def get_context(ifc_file, context, subcontext=None, target_view=None):
|
||||
if subcontext or target_view:
|
||||
@@ -33,6 +35,9 @@ def get_context(ifc_file, context, subcontext=None, target_view=None):
|
||||
|
||||
|
||||
def is_representation_of_context(representation, context, subcontext=None, target_view=None):
|
||||
if isinstance(context, ifcopenshell.entity_instance):
|
||||
return representation.ContextOfItems == context
|
||||
|
||||
if target_view is not None:
|
||||
return (
|
||||
representation.ContextOfItems.is_a("IfcGeometricRepresentationSubContext")
|
||||
|
||||
Reference in New Issue
Block a user