Revit API C# ResultsPackage

Revit API C# ResultsPackage

Anonymous
Not applicable
2,137 Views
8 Replies
Message 1 of 9

Revit API C# ResultsPackage

Anonymous
Not applicable

Hi everyone!

 

I have a ResultsPackageBuilder instance, which calls the SetBarResult method to set the forces and moments results on a Revit model (SetBarResult.png). 

Now, I want to get that results from the Revit model to put them elsewhere, and to do it, I created a ResultsPackage instance, and then, I called the GetBarNodeResult method (GetBarResult.png), but I get an empty list of results. So, what should I use instead to get the correct results? (I expected that ResultsPackage class has a GetBarResult method, but it doesn't)

0 Likes
Accepted solutions (1)
2,138 Views
8 Replies
Replies (8)
Message 2 of 9

augusto.goncalves
Alumni
Alumni
I may be missing something here... but this ResultsBuilder reference is not an Autodesk library, is that correct?
Regards,



Augusto Goncalves
Twitter @augustomaia
Autodesk Developer Network
0 Likes
Message 3 of 9

Anonymous
Not applicable

That ResultsPackageBuilder is contained in namespace Autodesk.DB.Revit.ResultsBuilder.Storage, so it is an Autodesk library.

 

Thanks.

0 Likes
Message 4 of 9

arnostlobel
Alumni
Alumni
I do not believe we have ResultsPackageBuilder in the Revit API. Are you by any chance developing on top of a Revit Extension (REX)?

Arno?t
Arnošt Löbel
0 Likes
Message 5 of 9

Anonymous
Not applicable

To see the results sets for a model in Revit, I had to install an extension named AutodeskStructuralAnalysisToolkitforAutodeskRevit2016 made by Autodesk. Then, in Revit appeared a new tab named Analyze(see RevitExtension.png). Also, in the References folder of the C# project, I have a dll named ResultsBuilder after I installed this kit, and that classes that I used( ResultsPackageBuilder and ResultsPackage) are part of this dll.

 

Thanks!

0 Likes
Message 6 of 9

arnostlobel
Alumni
Alumni
Thank you for confirming my hunch.
Revit Extensions aren't technically part of Revit, even though they are (or some are) developed by Autodesk. They need to be downloaded and installed, which makes them somehow comparable to other common external applications. It is why there is no on-line help available for extensions in the basic Revit API SDK. (Although I've found "REX SDK" folder under the main SDK folder - I am not sure if that gets installed by default, though.)

One thing I can do, however, is to reach out to the developers of this particular extension and bring your problem to their attention.

Thank you
Arnošt Löbel
0 Likes
Message 7 of 9

Anonymous
Not applicable

Thank you so much for the interest in my problem! 🙂

0 Likes
Message 8 of 9

_ew
Alumni
Alumni
Accepted solution

Hi,

Below is a code snippet to read linear results from a specific element, for a set of load cases

private String ReadLinearResults( ResultsPackage resultsPackage, ElementId elementId, ElementId []loadCaseIds)
{
// Set a list of result type elements
IList<LinearResultType> linearResultTypes = new List<LinearResultType>() { LinearResultType.Fx, LinearResultType.Fy, LinearResultType.Fz, LinearResultType.Mx, LinearResultType.My, LinearResultType.Mz };
List<ElementId> elementIds = new List<ElementId>() { elementId };

// Read results from the package
IList<LineGraph> graphs = resultsPackage.GetLineGraphs(elementIds, loadCaseIds, linearResultTypes, new LineGraphParameters( UnitsSystem.Metric ) );

// Format results
return FormatLinearResultsOutput( "Linear results", graphs);
}

 

If you still have some issues,  you may have a look at the ResultsBuilder samples. There is a sample that shows how to create a package and store results and a second one to access these results . Both samples are located here ..\Revit 2016 SDK\Structural Analysis SDK\Examples\ResultsInRevit

 

Thanks

Emmanuel

 



Emmanuel Weyermann
Sr Software Architect
Link Name | Link Name | Link Name | Link Name
Message 9 of 9

Anonymous
Not applicable

This seems to be what I need more or less, because on the results package example from ExampleSet.png, that function returns a list that contains only 144 values, when totally there are 288 values. And, every entry of type LineGraph contains a list of 11 Autodesk.Revit.DB.UV points. Now, I see that for the first Fz, that has value 567.25, the points list looks like in PointsList.png, and I wonder if there is a rule of how can I get 567.25 from that points list. (Note that for a Fx / Fy / Fz that has value 0, the V values from the points list are 0).

 

Thank you!

0 Likes