Hi, I would like to know can I remove those points in this slab which made up by segment sketch lines.
Because I want to use shape by points in dynamo, so give them new points and shape it.
But those point in red will not be remove?
Hi, I would like to know can I remove those points in this slab which made up by segment sketch lines.
Because I want to use shape by points in dynamo, so give them new points and shape it.
But those point in red will not be remove?
i can just find in datashapes add points but not delete… option is reset Shape…
#Copyright (c) mostafa el ayoubi , 2017
#Data-Shapes www.data-shapes.net , elayoubi.mostafa@gmail.com
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.SlabShapeEditor
pts = IN[1]
_reset = IN[2]
UIunit = Document.GetUnits(doc).GetFormatOptions(UnitType.UT_Length).DisplayUnits
TransactionManager.Instance.EnsureInTransaction(doc)
watch = []
if _reset:
sshape.ResetSlabShape()
for i in pts:
watch.append(sshape.DrawPoint(XYZ(UnitUtils.ConvertToInternalUnits(i.X,UIunit),UnitUtils.ConvertToInternalUnits(i.Y,UIunit),UnitUtils.ConvertToInternalUnits(i.Z,UIunit))))
TransactionManager.Instance.TransactionTaskDone()
OUT = slab
KR
Andreas
Thanks,
I have same situation that can not find delete. but only move.
but finding those annoying points is so time wasting.
thanks for your code and reply.
Do you have a sample file posted somewhere?
The goal is to make every piece like picture by adding new point , but the point in red can not be good controlled (using api might be well? ). So I would like to delete.
sorry, so far I achieve only data search and not about to delete. I am still struggle.
Is there a Revit file posted somewhere for someone who’d like to help (ie: me, Andreas) to use as a basis for our work? If left to my own devices I’d likely build it in Revit 2024 which might not work for you…
Thank you, My project file size is too big, I can’t easily upload, and there have no selected export function in Revit. So,I am afraid not to upload file and still try out other workaround.
You need only have two floors in it; open detached, delete everything but a few floors (including views, and purge unused), and try to post that. Or at least tell us which Revit version you’re in…
This is the rvt. file
hello, undo and redo the floor to eliminate your points
(possible track)
can you show me the wider context, on how I can use this code in order to reset shapes of multiple elements at the same time?
Kind regards,
Willem
you have to iterate over your desired elements…
embed the scrit in a for-loop.
something like this:
# Demo
import sys
import clr
clr.AddReference("RevitAPI")
from Autodesk.Revit.DB import *
clr.AddReference("RevitNodes")
import Revit
clr.ImportExtensions(Revit.GeometryConversion)
clr.AddReference("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
doc = DocumentManager.Instance.CurrentDBDocument
uidoc = DocumentManager.Instance.CurrentUIApplication.ActiveUIDocument
UIunit = Document.GetUnits(doc).GetFormatOptions(UnitType.UT_Length).DisplayUnits
# 🛒 collect slabs
slabs = FilteredElementCollector(doc).OfCategory(BuiltInCategory.OST_Floors).WhereElementTypeIsNotElementType().ToElements()
sshape = slab.SlabShapeEditor
pts = IN[1]
_reset = IN[2]
# 🔓 Start to reset
TransactionManager.Instance.EnsureInTransaction(doc)
watch = []
try:
for slab in slabs:
if _reset:
sshape.ResetSlabShape()
for i in pts:
watch.append(sshape.DrawPoint(XYZ(UnitUtils.ConvertToInternalUnits(i.X,UIunit),UnitUtils.ConvertToInternalUnits(i.Y,UIunit),UnitUtils.ConvertToInternalUnits(i.Z,UIunit))))
except:
pass
TransactionManager.Instance.TransactionTaskDone()
# 🔒 reseted
OUT = slabs
variable pts and _reset has to be resolved.
in case of pts you have to access the geometry.
_reset i m not sure, if it is only true would be to easy.
KR
Andreas