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

tool: Update cad_audit_check.py #2548

Merged
merged 6 commits into from
Feb 3, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion extensions/pyRevitTools.extension/checks/cad_audit_check.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-

from pyrevit import script, revit, DB, DOCS
from pyrevit.forms import alert

from pyrevit.preflight import PreflightTestCase

from System.Windows import Window # Used for cancel button
Expand All @@ -23,6 +23,15 @@ def collect_cadinstances(active_view_only):
return cadinstances


# Manage Flexform cancel using .NET System.Windows RoutedEventArgs Class
class ButtonClass(Window): # to handle button event (https://stackoverflow.com/questions/54756424/using-the-on-click-option-for-a-revit-rpw-flexform-button)
@staticmethod
def cancel_clicked(sender, e):
window = Window.GetWindow(sender)
window.close()
script.exit()


# Manage Flexform cancel using .NET System.Windows RoutedEventArgs Class
def cancel_clicked(sender, e):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The cancel_clicked function is now redundant since it's been moved to the ButtonClass class. Please remove this duplicate function since it's no longer used (the FlexForm now uses ButtonClass.cancel_clicked).

window = Window.GetWindow(sender)
Expand Down Expand Up @@ -86,6 +95,8 @@ def get_load_stat(cad, is_link):
return ":warning: IMPORTED" # Not an external reference
exfs = cad_type.GetExternalFileReference()
status = exfs.GetLinkedFileStatus().ToString()
if status == "Loaded":
return "Loaded"
jmcouffin marked this conversation as resolved.
Show resolved Hide resolved
if status == "NotFound":
return ":cross_mark: NotFound"
if status == "Unloaded":
Expand Down