Line Load, Point Load API changes in REVIT 2025

Wizards, I have just begun in REVIT 2025 and attempted to run a script which I have used on all previous versions of REVIT but am now getting errors. I have been searching high and low to find the assumed API changes but can’t find anything. Quite some time ago, i developed python scripts to in turn develop and place line loads or points loads using inputted data. Does anyone have any idea how to attack these changes? I have attached images with the errors i am receiving, as well as the current python script i have been using. Can anyone shed some light as to what i need to be changing in order for this to work in 2025?

Point Load Error:

Point Load Python:

Line Load Error:

Line Load Python:

@dweber12

i think when you follow the revit API, it should work

@Draxl_Andreas. The script has worked in all versions but 2025. Something has changed within 2025 in regard to how the line load and point loads are developed. Are you stating that the sketch plane has changed or am I misunderstanding you?

Are you using the same Python engine in each Revit instance?

Correct. I have used the script in versions from 2019 up to 2024 and never had an issue. There is something in the way the loads are now being created in 2025 that has changed. I cannot find anything when searching though. I do find articles showing load creation has changed, but no where does it say what.

2019 didn’t have a CPython engine, nor did 2020 and I believe only some versions for 2021. I believe it was 2022 was the introduction, and many were and are still running IronPython2 to this day. So as the new screenshots indicate CPython and you’re indicating 2019 we know you have changed Python engines; the question is when you changed Python engines.

Try installing the IronPython 2 or IronPython 3 engine in 2025 and confirm if they code fails there too.

I believe that the load classes have changed in 2023, 2024, and 2025. But 2025 has a new .NET version so it may be part of the issue you’re having, and as you indicated 2024 worked we can likely discount the prior issues. 2023 had the most significant changes as noted in the building coder site here: https://thebuildingcoder.typepad.com/blog/2022/04/whats-new-in-the-revit-2023-api.html#4.1.2.6

All of that said, it’s tough to troubleshoot from screenshots alone. Post a very basic model for 2023, a very basic model for 2025, and a graph to create the load in the 2023 model but which fails in 2025 - keep the stuff before the Python node to a minimum (say select element, location, and point at parameter).

1 Like

Tried both IronPython2 and IronPython3 and both fail with the same exact error as with CPython. Though in all versions prior to 2025 everyone was able to just draw a line load or point manually on a specific level. What i have noticed in 2025 is that you have to the analytical model developed prior to being able to draw a load. It seems as though something with the where the line load is placed has changed. I put red box around where i believe the issue is occuring. In versions prior to 2025 the line load was associated to a SketchPlane where now it needs an analytical element it seems. Though before i was able to see in API how the lineload.create worked. I am yet to find it for 2025.

This is what was required to develop loads in versions prior to 2025. This method matches what i have in my original script as shown in above image.

@jacob.small after searching and searching i think my initial thought was correct. It looks as though in 2025 the way the LineLoad.Create or PointLoad.Create is developed has new requirements.


Which i thought i had figured out with changing the Python Code to accommodate the new for a host element but not i am getting an error showing this.
image

New Code I attempted to develop is as follows. Any thoughts?

import clr
clr.AddReference("RevitAPI")
from Autodesk.Revit.DB import *
from Autodesk.Revit.DB.Structure import *

clr.AddReference("RevitNodes")
import Revit
clr.ImportExtensions(Revit.Elements)
clr.ImportExtensions(Revit.GeometryConversion)

clr.AddReference("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager

doc = DocumentManager.Instance.CurrentDBDocument

host = IN[0]
points = IN[1]
force = IN[2]
moment = IN[3]
PLType = UnwrapElement(IN[4])

loads = []

TransactionManager.Instance.EnsureInTransaction(doc)
for host,points,force,moment,PLType in zip(host,points,force,moment,PLType):
    new_load = PointLoad.Create(doc,host.ElementId(),points.ToXyz(),force.ToXyz(),moment.ToXyz(),PLType)
   
TransactionManager.Instance.TransactionTaskDone()
OUT = loads

Hard to say without the files noted before as I have no idea what you are providing for inputs. Best guess one of them is an element ID collected in the dynamo environment but should be an analytical element.

Structural analysis got a overhaul a year or two ago, and i think old methods may have changed inputs over that time. They may have set things to obsolete for a additional version before they got removed too.

Therefore i would suggest you have the method change depending on the revit version as the input order does change!

Previous Revits - Create Method
Revit 2023 - Create Method
Revit 2024 - Create Method

Something that may be of use is to utilise the Overloads python option to pick a specific method, this can sometimes be the issue that it trys to utilise a different method than what you wanted. So you can then utilise the overload to make it utilise a specific one, though do watch out that the index could be different between versions of revit!

To utilise “Overloads” with “Functions[?]” between your method and the start of the brackets.

See line 91 in below image shows where this is placed in a call.
image

Side tip:

If you want to try and find out which function you are trying to call by the “” at the end then you can do this with another other little trick.

You can grab all the functions and do a for loop each one while grabbing the documentation associated via the “doc” attribute, which the below snippet shows the code to use.

Then you can read through the output to see which list index should be used.

Image attached i have attempted to use the Analytical Element as input.

When using this method i get this error: which is telling me i need to input the element id.
image

Image attached here i attempted to use the element ID for the input:

When using this method i get this error: which is telling me that i need an element ID
image

I am sorry for overloading everyone here on this topic but it is truly making zero sense.
Current python code i have in node is as follows, in the case anyone wants to see it.

import clr
clr.AddReference("RevitAPI")
from Autodesk.Revit.DB import *
from Autodesk.Revit.DB.Structure import *

clr.AddReference("RevitNodes")
import Revit
clr.ImportExtensions(Revit.Elements)
clr.ImportExtensions(Revit.GeometryConversion)

clr.AddReference("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager

doc = DocumentManager.Instance.CurrentDBDocument

host = UnwrapElement(IN[0])
points = IN[1]
force = IN[2]
moment = IN[3]
PLType = UnwrapElement(IN[4])

loads = []

TransactionManager.Instance.EnsureInTransaction(doc)
for host,points,force,moment,PLType in zip(host,points,force,moment,PLType):
    new_load = PointLoad.Create(doc,host.ElementId(),points.ToXyz(),force.ToXyz(),moment.ToXyz(),PLType)
   
TransactionManager.Instance.TransactionTaskDone()
OUT = loads

Correct. Main changes occured in 2023 but the create methods have remained the same until 2024.
Up until REVIT 2024 the create methods required a sketch plane.


In REVIT 2025 the create method now requires an element ID

This new method is what i thought i changed my Python Script to accommodate, but i cannot find a way for it to accept the element ID for the analytical floor where the loads will be placed.

Hi,

try to replace

by

ElementId(host)

Note
it is better that the name of your variables is explicit example host_id_value instead of host

Understood. I switched to suggested replacement to ElementId(host_id_value), and changed all “host” variables to match the new host_id_value. The node runs but produces an empty list. No longer are there any errors but the results are empty which should not be the case.

you forgot to populate the loads list with :

loads.append(new_load)

forgive my ignorance. but you are saying input that down at the end of python?

OUT = loads.append(new_load)?

no, like this

loads = []

TransactionManager.Instance.EnsureInTransaction(doc)
for host,points,force,moment,PLType in zip(host,points,force,moment,PLType):
    new_load = PointLoad.Create(doc,host.ElementId(),points.ToXyz(),force.ToXyz(),moment.ToXyz(),PLType)
    loads.append(new_load)
   
TransactionManager.Instance.TransactionTaskDone()
OUT = loads

here is an example of Python training to get started

1 Like