Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When drawing activated: certain annotation is not turned on. #4134

Closed
theoryshaw opened this issue Dec 19, 2023 · 3 comments
Closed

When drawing activated: certain annotation is not turned on. #4134

theoryshaw opened this issue Dec 19, 2023 · 3 comments

Comments

@theoryshaw
Copy link
Member

When the 'REFLECTED CEILING PLAN` drawing is activated in the following file, certain annotation is not turned on.

file: https://hub.openingdesign.com/OpeningDesign/Restaurant_Sun_Prairie/src/commit/cd1cde163bea36c821fa03b657ddd06c58f1d12a/Models/BlenderBIM/Restaurant_Sun_Prairie.ifc

image

@theoryshaw
Copy link
Member Author

This only seems to happen in this drawing. May something unique about RCP contexts? Not sure.

@Andrej730
Copy link
Contributor

@theoryshaw hi! It's not related to RCP context specifically. The problem is with annotation type e.g. IfcTypeProduct/Light_Tag_Name - it's defining representation type in PLAN_VIEW context therefore it's filtered out when you activate RCP drawing.
image

So this type of annotation will be hidden in any drawings except PLAN_VIEW type. And I think it's already fixed - after cc59929 annotation type representation is defined in Model/Annotation/MODEL_VIEW, so they won't get filtered.
image

I've wrote a short script as a workaround to change context to Model_VIEW for all the annotation types and their occurences in the project, it should help.

import blenderbim.tool as tool
import ifcopenshell

ifc_file = tool.Ifc.get()
annotation_types = []
for p in ifc_file.by_type("IfcTypeProduct"):
    if p.is_a() != "IfcTypeProduct":
        continue
    if not p.ApplicableOccurrence.startswith("IfcAnnotation/"):
        continue
    annotation_types.append(p)

model_context = ifcopenshell.util.representation.get_context(ifc_file, "Model", "Annotation", "MODEL_VIEW")
for annotation_type in annotation_types:
    for rep_map in annotation_type.RepresentationMaps or []:
        rep = rep_map.MappedRepresentation
        if rep.RepresentationIdentifier != "Annotation":
            continue
        rep_type = rep.RepresentationType
        rep.ContextOfItems = model_context 

        for map_usage in rep_map.MapUsage:
            for referring_rep in ifc_file.get_inverse(map_usage):
                referring_rep.ContextOfItems = model_context 

@theoryshaw
Copy link
Member Author

Thanks @Andrej730 I should have caught that. :)
Thanks for the script, worked great!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants