So I have a .DYN all set up to modify and then export a schedule from Revit to Excel.
I’m actually a little proud of it. When using the player, you type in the parameter value that you want to filter into the schedule. It actually applies a filter to the schedule that is specified by the user input. It names the Sheet with a description of the report and even has the current date as well. It has a dialog box that should pop up in the middle with a brief explanation of what the script does, and reminds the user to reset the filter before running the script again. (I haven’t added that in yet.)
But I am at a loss, because every time I run the script it does things backasswards. The schedule will be exported in full to Excel… and THEN it will apply the filter to the schedule.
import clr clr.AddReference('RevitAPIUI') from Autodesk.Revit.UI import * sYs = IN SchedView = IN title = IN + " System Quantity Report" mainDialog = TaskDialog("Don't forget to reset the filter!") mainDialog.MainInstruction = title mainDialog.MainContent = """This script accomplishes two tasks: 1. Adjust the filter that is applied to the System Quantity Report Schedule's data to only include the defined System. 2. The resulting data will then be exported to an Excel Spreadsheet with the appropriate Sheet Name. Don't forget to delete the resulting filter pertaining to the System Quantity Report Schedule in Revit, before you run this script again. Thank you""" #mainDialog.AddCommandLink(TaskDialogCommandLinkId.CommandLink1, sYs) #mainDialog.AddCommandLink(TaskDialogCommandLinkId.CommandLink2, "Lets fuck some shit up fam") #mainDialog.CommonButtons = TaskDialogCommonButtons.Close; #mainDialog.DefaultButton = TaskDialogResult.Close; #mainDialog.FooterText = "Click here for the Revit API Developer Center" tResult = mainDialog.Show() OUT = [tResult, IN]
I’ll post the .DYN screenshot, but I just don’t know where to start fixing this. I just want a way to get the script to wait till after the dialog box has been closed by the user, and then export the schedule. Does anyone have any ideas on how I can make this happen?