Results Package Create with Api

Results Package Create with Api

Frasani
Participant Participant
794 Views
6 Replies
Message 1 of 7

Results Package Create with Api

Frasani
Participant
Participant

I did a plugin that export the analytical model to SAP 2000 and after the calculation I would like create a ResultPackage with api to show all results also in Revit. It's possible? I found an example in Revit 2025 SDK folder that its calls ResultsInRevit, and I saw two references...

 

using Autodesk.Revit.DB.ResultsBuilder;
using Autodesk.Revit.DB.ResultsBuilder.Storage;

 

I cant find these references inside api dll...

 

Anyone know how to do this? Thanks so much.

0 Likes
795 Views
6 Replies
Replies (6)
Message 2 of 7

jeremy_tammik
Alumni
Alumni

I don't know whether this will help?

  

  

It is 11 years old...

  

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open
0 Likes
Message 3 of 7

Frasani
Participant
Participant

Seems that solution does not works more for new version of Revit. I tried to explore some functions but I can't find, inclusive the libraries...like I mentioned over. The strange is, these files I can find inside 2025 Revit SDK.

0 Likes
Message 4 of 7

jeremy_tammik
Alumni
Alumni

They may no longer exist. The structural API may have been restructured. What is your ultimate goal? How do you achieve it manually in the UI?

    

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open
0 Likes
Message 5 of 7

Frasani
Participant
Participant

1 - I constructed the Analytical Model with base information from other software.
2 - In Revit I give the liberaty to the user to see all loads, nodes, members... and he has the option to add more elements...
3 - After this, I export the model analytical to json and Import into Sap2000 (or other) and I do the structure calc.
4 - With results that I get from Sap into a Json, I would like show moment, force diagrams constructed with Revit api. Today it's possible with api?

 

ps: all this process made with Revit API less Sap2000 part.

0 Likes
Message 6 of 7

akoukouselis
Explorer
Explorer

Not sure if you found it. I am struggling with a similar issue.

have a look here "C:\Program Files\Autodesk\Revit 2025\AddIns\ResultsManagerExplorer" and reference Autodesk.ResultsBuilder.DBApplication.dll

Also have a look here https://forums.autodesk.com/t5/revit-api-forum/structural-analysis-toolkit-resultsbuilder-reviewing-...

Still the examples are pretty old so the code needs some tweeks (eg for the ForgetypeID).

 

I hope someone from Autodesk creates some updated examples regarding this functionality. Especially if we take into consideration the major changes in the API.

In my case the example works (not perfectly) for linear results but for surface results nothing comes up.

0 Likes
Message 7 of 7

akoukouselis
Explorer
Explorer

I had a better look in the ResultsBuilder functionality and decided to summarize and share some information here that other users may find helpful.

  • Reference to the relevant Dll "Autodesk.ResultsBuilder.DBApplication.dll" may be found under the revit installation directory \addins\ResultsManagerExplorer e.g. C:\Program Files\Autodesk\Revit 2025\AddIns\ResultsManagerExplorer
  •  Examples of the SDK are a little old. Thus, code needs some changes as for example using ForgeTypeId. For example AddMeasurement(result.Item1, MeasurementResultType.Surface, UnitType.UT_Area, DisplayUnitType.DUT_SQUARE_METERS, MeasurementDependencyType.LoadCaseIndependent);  Should be changed to AddMeasurement(result.Item1, MeasurementResultType.Surface, SpecTypeId.Area, UnitTypeId.SquareMeters, MeasurementDependencyType.LoadCaseIndependent);  
  • In a similar manner you have to take into account the changes in the Structures API and the newer structural analysis model.
    E.g.
    AnalyticalModel analyticalModel = (doc.GetElement(elementId) as AnalyticalModel);
    IList<Curve> curves = analyticalModel.GetCurves(AnalyticalCurveType.RawCurves);
    is now
    AnalyticalPanel analyticalModel = (doc.GetElement(elementId) as AnalyticalPanel);
    IList<Curve> curves = analyticalModel.GetOuterContour().ToList();
  • It is not always clear in the examples but the results are provided in Units and not relative to the length of the member. E.g. xCoordinateValues = new List<double>() { 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0 }; means 0.1, 0.2 …. meters and not 10% of the length.
  • Care should be taken with units when introducing data. In contrast with the rest of the API that the internal units of Revit should be used when sending data, the results builder does not. Have not tested it with imperial units and I am not sure if it is related with the UnitsSystem declared in the CreateResultsPackage method, but in my case(and the example of the SDK) data (length area etc) are in metric system. So do not convert to  Internal. On the other hand you might need to convert from internal. The reason I did not get any results for the surface element was that the GetSurfaceContourPoints method returned the XYZ points in the Internal Units of Revit (Imperial) so I had to convert them to metric.

From my understanding, the ResultManager actually uses the AVF so it is up to you to decide whether it is more suited for your case to go for the ResultsBuilder and Manager or directly for the AVF. Here are some pros and cons.

  • Using the ResultsBuilder will get you where you want to be probably faster since you do not have to set up your own handling of results packages data.  Also no need to create your own user interface for handling result presentation. Last but not least you do not have to handle AVF, with clearing and creating spatialfieldmanagers schemas etc …
  • On the other hand you will “inherit” the limitations of the ResultsBuilder meaning you cannot intervene with how data are stored and sometimes presented. For example, when using AVF directly you can flag which data points are to be tagged with text for diagrams.  Also did not find a way to present results that are not based on an analytical member with ResultsBuilder. AVF supports the presentation of results with references that are not based on actually Revit elements.

Thus, I think that if you want just to show some results in Revit that are typical in the structural discipline go with ResultsBuilder. On the other hand if you want to present more complex data or need more control on the data you are better off with implementing your own datastructure and use AVF directly.

0 Likes