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

added Load Families.pushbutton #1041

Merged
merged 2 commits into from
Nov 8, 2020
Merged

Conversation

hikib
Copy link
Contributor

@hikib hikib commented Oct 25, 2020

New bundle to load families from a directory, recursively.
Related to issue #1015 .

Workflow

  1. Select a directory.
  2. Select Families (*.rfa files) from the directory.
  3. Select loading option (load all Types OR select Type(s) for each Family)
    (4. Select Family Type(s) for each Family)

Notes on bundle

  • Tested on Revit 2019, 2020 with up to 450 families, loading all types.
  • Reports at the end about families that were already loaded (if family name exists in project).
  • If user decides on selecting types for each family, single type families will be loaded without prompt.
  • Excludes backup files (xxx.0001.rfa)
  • Has progress bar with cancel button and count.

Notes on the code

  • pathlib module to find files recursively by globbing
    • pathlib is part of the standard lib of python since v3.4. Can be replaced with os.walk or os.path.walk, depending on python version.
  • itertools.ifilterfalse to filter out backup files. Can be replaced by re.match.

@hikib
Copy link
Contributor Author

hikib commented Oct 26, 2020

I moved the pushbutton into a new pulldown with 'Load More Types'.
The pulldown is missing an icon. Any suggestions are welcome and i´ll add it in a commit with other changes after more reviews.

@eirannejad
Copy link
Collaborator

Uh sweet!

@eirannejad eirannejad linked an issue Nov 2, 2020 that may be closed by this pull request
@eirannejad eirannejad changed the base branch from develop to pr/1041 November 8, 2020 19:35
@eirannejad eirannejad merged commit 4af002b into pyrevitlabs:pr/1041 Nov 8, 2020
@eirannejad
Copy link
Collaborator

Merged for review

@eirannejad
Copy link
Collaborator

Merged into develop and will be published with v4.8.4

@hikib hikib deleted the load_families branch November 8, 2020 22:23
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.

Load all families from folder tree
2 participants