Cannot create point loads in Revit 2024

Cannot create point loads in Revit 2024

junlin001
Explorer Explorer
819 Views
7 Replies
Message 1 of 8

Cannot create point loads in Revit 2024

junlin001
Explorer
Explorer

1.  The example to create point load in Revit 2024 API (structure) does not compile

public void CreatePointLoad(Document document)
{
// Define the location at which the PointLoad is applied. XYZ point = new XYZ(0, 0, 4);
// Define the 3d force. XYZ force = new XYZ(0, 0, -1);
// Define the 3d moment. XYZ moment = new XYZ(0, 0, 0);

PointLoad pointLoad = PointLoad.Create(document, point, force, moment, null, null);
}

 

2. Then I tried to first create a host, then assign a load to the host
FamilyInstance instance = _document.Create.NewFamilyInstance(curve, symbol, levelBase, structuralType);
bool isValid = PointLoad.IsValidHostId(_document, elementId);
pointLoad = PointLoad.Create(_document,instance.Id, xyz, xyzForce, xyzMoment, null);
I got error "hostElemId is not permitted to host this type of load".
Can someone show me how I can create a point load the correct way? 

 

0 Likes
820 Views
7 Replies
Replies (7)
Message 2 of 8

moturi.magati.george
Autodesk
Autodesk

Hi @junlin001,

 

I have reproduced the issue and raised it with the development team here
I will update once they respond.

Thank you

  Moturi George,     Developer Advocacy and Support,  ADN Open
0 Likes
Message 3 of 8

moturi.magati.george
Autodesk
Autodesk

Hello @junlin001,

I received a response from the development team.

Starting with Revit 2024 you can create only hosted loads. This is the reason why for this method you get an error: PointLoad pointLoad = PointLoad.Create(document, point, force, moment, null, null).

For the second case, where you pass host element id: accepted hosts are analytical members or analytical panels elements (this is the reason you get the error saying that "host is not permitted")


  Moturi George,     Developer Advocacy and Support,  ADN Open
Message 4 of 8

junlin001
Explorer
Explorer

Thank you, Moturi.  Can you provide a simple example in c# or VB.NET here?

Message 5 of 8

RPTHOMAS108
Mentor
Mentor

The example you are looking for is already in the RevitAPI.chm under PointLoad.Create, when you use that you should pick an analytical element not a physical one (such as FamilyInstance).

 

 

0 Likes
Message 6 of 8

junlin001
Explorer
Explorer

This is the document I can find: https://help.autodesk.com/view/RVT/2024/ENU/?guid=Revit_API_Revit_API_Developers_Guide_Discipline_Sp...

The code sample there does not work for me.

 

Where can I download RevitAPI.chm?  I cannot find the file under the installation folder (C:\Program Files\Autodesk).

Message 7 of 8

pierre
Explorer
Explorer

Thank you, however the only example I found in the PointLoad class in the RevitAPI.chm was: Getinfo_PointLoad(PointLoad pointLoad) which does not illustrate the Create method. Any chance you could post the sample you were referring to?

0 Likes
Message 8 of 8

junlin001
Explorer
Explorer

I was finally able to create a point load by 

1. First create an AnalyticalMember and pass its elementId in the following
2. use PointLoad.Create(_document, elementId, xyz, xyzForce, xyzMoment, null);