then try something
Hi, here is a solution
by titillating the api
Python code
import sys
import clr
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *
clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import *
clr.AddReference('RevitServices')
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
import System
from System.Collections.Generic import List
clr.AddReference('RevitNodes')
import Revit
clr.ImportExtensions(Revit.Elements)
clr.ImportExtensions(Revit.GeometryConversion)
doc = DocumentManager.Instance.CurrentDBDocument
# Inputs
R_cir=IN[0]/0.3048
Lvl_h=UnwrapElement(IN[1]).Elevation
Lvl_Id=UnwrapElement(IN[1]).Id
Floor_Type_Id=UnwrapElement(IN[2]).Id
Delta_Z=IN[3]/0.3048
#Create the 2 floors
Arc_Floor=Arc.Create(XYZ(0,-R_cir,Lvl_h),XYZ(0,R_cir,Lvl_h),XYZ(R_cir,0,Lvl_h))
Line_Floor=Line.CreateBound(XYZ(0,R_cir,Lvl_h),XYZ(0,-R_cir,Lvl_h))
Arc_Floor2=Arc.Create(XYZ(0,-R_cir,Lvl_h),XYZ(0,R_cir,Lvl_h),XYZ(-R_cir,0,Lvl_h))
curv_1=CurveLoop()
curv_1.Append(Arc_Floor)
curv_1.Append(Line_Floor)
curv_2=CurveLoop()
curv_2.Append(Arc_Floor2)
curv_2.Append(Line_Floor)
TransactionManager.Instance.EnsureInTransaction(doc)
flr1=Floor.Create(doc,List[CurveLoop]([curv_1]), Floor_Type_Id, Lvl_Id)
flr2=Floor.Create(doc,List[CurveLoop]([curv_2]), Floor_Type_Id, Lvl_Id)
doc.Regenerate()
pt_sup_1=flr1.SlabShapeEditor.DrawPoint(XYZ(0,0,Lvl_h))
pt_sup_2=flr2.SlabShapeEditor.DrawPoint(XYZ(0,0,Lvl_h))
modif_1=flr1.SlabShapeEditor.ModifySubElement(pt_sup_1,-Delta_Z)
modif_2=flr2.SlabShapeEditor.ModifySubElement(pt_sup_2,-Delta_Z)
TransactionManager.Instance.TransactionTaskDone()
OUT = [flr1,flr2]
Your advice and tips are not in vain thank you Mr. Poupin
and thank you for also solving Mr. Sovitek ![]()
edit:
a single slab (I think I have taken the trick of the 2 half arcs for the circle under the API) + addition of the hopper
Python code
import sys
import clr
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *
clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import *
clr.AddReference('RevitServices')
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
import System
from System.Collections.Generic import List
clr.AddReference('RevitNodes')
import Revit
clr.ImportExtensions(Revit.Elements)
clr.ImportExtensions(Revit.GeometryConversion)
doc = DocumentManager.Instance.CurrentDBDocument
# Inputs
R_cir=IN[0]/0.3048
Lvl_h=UnwrapElement(IN[1]).Elevation
Lvl_Id=UnwrapElement(IN[1]).Id
Floor_Type_Id=UnwrapElement(IN[2]).Id
Delta_Z=IN[3]/0.3048
R_v=IN[4]/0.3048
#Create the geometry of the floor
Arc_Floor1=Arc.Create(XYZ(0,-R_cir,Lvl_h),XYZ(0,R_cir,Lvl_h),XYZ(R_cir,0,Lvl_h))
Arc_Floor2=Arc.Create(XYZ(0,R_cir,Lvl_h),XYZ(0,-R_cir,Lvl_h),XYZ(-R_cir,0,Lvl_h))
curv_1=CurveLoop()
curv_1.Append(Arc_Floor1)
curv_1.Append(Arc_Floor2)
#Create the geometry of the void
Arc_Floor3=Arc.Create(XYZ(0,-R_v,Lvl_h),XYZ(0,R_v,Lvl_h),XYZ(R_v,0,Lvl_h))
Arc_Floor4=Arc.Create(XYZ(0,R_v,Lvl_h),XYZ(0,-R_v,Lvl_h),XYZ(-R_v,0,Lvl_h))
curv_2=CurveArray()
curv_2.Append(Arc_Floor3)
curv_2.Append(Arc_Floor4)
#Beginnning off transactions
TransactionManager.Instance.EnsureInTransaction(doc)
flr1=Floor.Create(doc,List[CurveLoop]([curv_1]), Floor_Type_Id, Lvl_Id)
doc.Regenerate()
pt_sup_1=flr1.SlabShapeEditor.DrawPoint(XYZ(0,0,Lvl_h))
modif_1=flr1.SlabShapeEditor.ModifySubElement(pt_sup_1,-Delta_Z)
void_=doc.Create.NewOpening(flr1,curv_2,True)
TransactionManager.Instance.TransactionTaskDone()
OUT = [flr1]
Cordially
christian.stan



