Requests a new systems analysis to be run in the background.
Namespace: Autodesk.Revit.DB.AnalysisAssembly: RevitAPI (in RevitAPI.dll) Version: 26.4.0.0 (26.4.0.0)
Syntax
C#
public void RequestSystemsAnalysis(
SystemsAnalysisOptions options
)
Parameters
- options SystemsAnalysisOptions
-
The additional options to run systems analysis. If empty, use the default value in the view element.
The request may download the weather file at current site location if not specified in the options.
Exceptions
Remarks
Should be called from a transaction.
Example
C#
ViewSystemsAnalysisReport newReport = null;
SystemsAnalysisOptions theOptions = new SystemsAnalysisOptions();
string openStudioPath = Path.GetFullPath(Path.Combine(doc.Application.SystemsAnalysisWorkfilesRootPath, @"..\"));
theOptions.WorkflowFile = Path.Combine(openStudioPath, @"workflows\HVAC Systems Loads and Sizing.osw");
theOptions.OutputFolder = Path.GetTempPath();
using (Transaction transaction = new Transaction(doc))
{
transaction.Start("Create Systems Analysis View");
newReport = ViewSystemsAnalysisReport.Create(doc, "APITestView");
if (newReport != null)
{
newReport.RequestSystemsAnalysis(theOptions);
transaction.Commit();
}
else
{
transaction.RollBack();
}
}
VB
Dim newReport As ViewSystemsAnalysisReport = Nothing
Dim theOptions As SystemsAnalysisOptions = New SystemsAnalysisOptions()
Dim openStudioPath As String = Path.GetFullPath(Path.Combine(doc.Application.SystemsAnalysisWorkfilesRootPath, "..\"))
theOptions.WorkflowFile = Path.Combine(openStudioPath, "workflows\HVAC Systems Loads and Sizing.osw")
theOptions.OutputFolder = Path.GetTempPath()
Using t As New Transaction(doc, "Create Systems Analysis View")
t.Start()
newReport = ViewSystemsAnalysisReport.Create(doc, "APITestView")
If newReport IsNot Nothing Then
newReport.RequestSystemsAnalysis(theOptions)
t.Commit()
Else
t.RollBack()
End If
End Using
See Also
Reference