Skip to content

Added operator to add psets to all selected objects. #1805

Merged
Moult merged 2 commits intoIfcOpenShell:v0.7.0from
vulevukusej:add_psets_to_selected_objects
Oct 20, 2021
Merged

Added operator to add psets to all selected objects. #1805
Moult merged 2 commits intoIfcOpenShell:v0.7.0from
vulevukusej:add_psets_to_selected_objects

Conversation

@vulevukusej
Copy link
Copy Markdown
Contributor

See discussion: #1691

@vulevukusej
Copy link
Copy Markdown
Contributor Author

I feel like this line of code is a bit noobish, but I didn't know how else to check PsetProperties, since there's no way to check all items of a dynamically generated enum in Blender:

if f"'{selected_pset}'" in str(prop.getPsetNames("", context)):

@Moult Moult merged commit 871ad1a into IfcOpenShell:v0.7.0 Oct 20, 2021
@Moult
Copy link
Copy Markdown
Contributor

Moult commented Oct 20, 2021

Almost there, I've made a few tweaks and merged :) Here's what you missed:

  1. Property sets can be added to graphical objects, true, but they also be added to all sorts of other fun non-geometric things like materials, portions of materials, construction tasks, resources, schedules, and even standardised structural profiles. Isn't BIM complex and fun? :) So selected_objects only works for one type of pset assignment.
  2. Any selected element that is not a BIM element should be skipped.
  3. To answer your question, you can call blenderbim.bim.schema.ifc.psetqto.get_applicable_names directly :)

Really appreciate your contributions! Keep it up!

@vulevukusej
Copy link
Copy Markdown
Contributor Author

Awesome! :)

@vulevukusej vulevukusej deleted the add_psets_to_selected_objects branch October 20, 2021 06:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants