Convert floor or roof to shape edited without moving points

Hi,

How can I convert a bunch of floors or roofs to shape edited so that they have the points, but without providing an external list of points? I just want the points to stay where they are (similar to clicking modify sub elements in revit and then escaping).

I want to extract the points of non shape edited floors, and it’s not working using the “Floor.Points” node.

To do so, all you have to do is access the floor’s SlabShapeEditor and use the method Enable

A quick python excerpt would be something like this:

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
floor = UnwrapElement(IN[0])

TransactionManager.Instance.EnsureInTransaction(doc)

floor.SlabShapeEditor.Enable()
bool = floor.SlabShapeEditor.IsEnabled

TransactionManager.Instance.TransactionTaskDone()

OUT = bool

This works for single floors, to do a list you just need to add a for loop.

2 Likes

The same method should work for roofs, as both extrusion roofs and footprint roofs also have the slabshapeeditor property.

Thanks! This works great. I have modified the code to include a for loop and single quotes for use in a “python script from string” node. It’s available below for future reference.

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
floor = UnwrapElement(IN[0])

TransactionManager.Instance.EnsureInTransaction(doc)

bool = []

for i in floor:
	i.SlabShapeEditor.Enable()
	bool.append(i.SlabShapeEditor.IsEnabled)

TransactionManager.Instance.TransactionTaskDone()

OUT = bool
2 Likes