forked from mitevpi/revit-wpf-template
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
47 changed files
with
83 additions
and
112 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
using Autodesk.Revit.DB; | ||
using Autodesk.Revit.UI; | ||
|
||
namespace RevitTemplate | ||
{ | ||
/// <summary> | ||
/// This is an example of of wrapping a method with an ExternalEventHandler using a string argument. | ||
/// Any type of argument can be passed to the RevitEventWrapper, and therefore be used in the execution | ||
/// of a method which has to take place within a "Valid Revit API Context". | ||
/// </summary> | ||
public class EventHandlerWithStringArg : RevitEventWrapper<string> | ||
{ | ||
/// <summary> | ||
/// The Execute override void must be present in all methods wrapped by the RevitEventWrapper. | ||
/// This defines what the method will do when raised externally. | ||
/// </summary> | ||
public override void Execute(UIApplication uiApp, string args) | ||
{ | ||
// Do your processing here with "args" | ||
TaskDialog.Show("External Event", args); | ||
} | ||
} | ||
|
||
/// <summary> | ||
/// This is an example of of wrapping a method with an ExternalEventHandler using an instance of WPF | ||
/// as an argument. Any type of argument can be passed to the RevitEventWrapper, and therefore be used in | ||
/// the execution of a method which has to take place within a "Valid Revit API Context". This specific | ||
/// pattern can be useful for smaller applications, where it is convenient to access the WPF properties | ||
/// directly, but can become cumbersome in larger application architectures. At that point, it is suggested | ||
/// to use more "low-level" wrapping, as with the string-argument-wrapped method above. | ||
/// </summary> | ||
public class EventHandlerWithWpfArg : RevitEventWrapper<Ui> | ||
{ | ||
/// <summary> | ||
/// The Execute override void must be present in all methods wrapped by the RevitEventWrapper. | ||
/// This defines what the method will do when raised externally. | ||
/// </summary> | ||
public override void Execute(UIApplication uiApp, Ui ui) | ||
{ | ||
// SETUP | ||
UIDocument uiDoc = uiApp.ActiveUIDocument; | ||
Document doc = uiDoc.Document; | ||
|
||
// METHODS | ||
if (ui.CbDocumentData.IsChecked == true) | ||
{ | ||
Methods.DocumentInfo(ui, doc); | ||
} | ||
|
||
if (ui.CbSheetData.IsChecked == true) | ||
{ | ||
Methods.SheetRename(ui, doc); | ||
} | ||
|
||
if (ui.CbWallData.IsChecked == true) | ||
{ | ||
Methods.WallInfo(ui, doc); | ||
} | ||
} | ||
} | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 0 additions & 1 deletion
1
Revit Debug App/RevitEventWrapper.cs → Revit Template/RevitEventWrapper.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
using Autodesk.Revit.UI; | ||
using System; | ||
|
||
namespace RevitTemplate | ||
{ | ||
|
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters