Hi everyone. In Revit 2023 we could easily add points to existing toposurface from csv file or from list of points in Dynamo. Does anyone know if there is a node Toposolid.AddPoints or can anyone help me to create a code for this task. It should have 2 inputs : list of points and
toposolid and the output toposolid?
Hi Jin, unfortunately it didn’t work for me in Revit 2024
Hi Vijay,
it doesn’t work.
I’m working on Revit 2024. It works.
Download the packages and test them with snapshots so that we can understand your problem.
For the Floor.AddPoint node, you click the “>” after the input “point” to use Level and set at @L1 for it. Then right click on the node to set Lacing > Cross Product. Then Run and check
For the SlabShape.AddPoints,
You right click to edit custom node.
Then right click on the python script to edit.
Then edit this line:
Because the new version works with “GetSlabShapeEditor”
be sure you have the right ironpython package installed as well…maybe
delete
There are some changes in Revit API not only about the SlabShapeEditor but also the Units
import clr
clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import*
clr.AddReference('RevitServices')
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
doc = DocumentManager.Instance.CurrentDBDocument
slab = UnwrapElement(IN[0])
sshape = slab.GetSlabShapeEditor() # For Revit 2024
pts = IN[1]
_reset = IN[2]
#For Revit 2024
intUnitsId = doc.GetUnits().GetFormatOptions(SpecTypeId.Length).GetUnitTypeId()
TransactionManager.Instance.EnsureInTransaction(doc)
watch = []
if _reset:
sshape.ResetSlabShape()
for i in pts:
watch.append(sshape.DrawPoint(XYZ(UnitUtils.ConvertToInternalUnits(i.X,intUnitsId),UnitUtils.ConvertToInternalUnits(i.Y,intUnitsId),UnitUtils.ConvertToInternalUnits(i.Z,intUnitsId))))
TransactionManager.Instance.TransactionTaskDone()
OUT = slab
Jin, you are amazing. This worked, huge thank you!
Hello can u pls explain what to be feed in “_reset = IN[2]”. It will be Boolean value?Thanks in advance
It’s a reset toggle using Boolean value in case dynamo do not run when no input changes. So it’s a “fake change” to dynamo rerun.
Without it, you need to freeze and run and unfreeze it and run again.
Actually, I do not deeply understand it as technical user. It’s just from my experiences.
I hope it helps!