Revit 2024. How to get the AnalyticalModel from element.

Revit 2024. How to get the AnalyticalModel from element.

van-son_dinh
Explorer Explorer
479 Views
2 Replies
Message 1 of 3

Revit 2024. How to get the AnalyticalModel from element.

van-son_dinh
Explorer
Explorer

the @ GetAnalyticalModel() method was deleted in Revit API 2024

0 Likes
Accepted solutions (1)
480 Views
2 Replies
Replies (2)
Message 2 of 3

Mohamed_Arshad
Advisor
Advisor
Accepted solution

Hi @van-son_dinh 

   

       In Revit 2024 Autodesk has changed the Workflow of Analytical Modeling. According to Manual modeling API also  Changed.

 

Analytical Model Classes

Mohamed_Arshad_0-1712211607735.png

Analytical Classes Additions

Mohamed_Arshad_1-1712211676190.png

Examples of New Classes

 

Analytical Member

Mohamed_Arshad_4-1712212082559.png

Analytical Panel

Mohamed_Arshad_5-1712212129745.png

 

GetAnalyticalModel Method Replacement

Mohamed_Arshad_2-1712211713618.png

2023 API Changes Document URL: https://thebuildingcoder.typepad.com/files/revit_platform_api_changes_and_additions_2023_08.pdf 

 

Example to Get Analytical Model from the Element (Make sure the Analytical Model is associated with Element)

Mohamed_Arshad_3-1712211804041.png



Reference Code

 ///Get Analytical Model from the Element Sample

            ///Get Complete Analytical Associations from the Model
            AnalyticalToPhysicalAssociationManager analyticalToPhysical = AnalyticalToPhysicalAssociationManager.GetAnalyticalToPhysicalAssociationManager(doc);

            if (analyticalToPhysical.HasAssociation(wallId))
            {
                AnalyticalMember analyticalModel = doc.GetElement(analyticalToPhysical.GetAssociatedElementId(wallId)) as AnalyticalMember;
            }

 

Hope this will Help 🙂


Mohamed Arshad K
Software Developer (CAD & BIM)

Message 3 of 3

van-son_dinh
Explorer
Explorer

Hello @Mohamed_Arshad 

Thanks for your detailed instructions, I followed this, and I got the expected results.
Have a good day.