Hi, I' using the following code to create a pitched roof in Vectorworks, but always got a pop-up error "Could not create roof, probably not enough walls". Does anyone know why?
# Define the coordinates for the roof base
roof_vertices = [(0, 3000), (5000, 3000), (5000, 0), (0, 0)]
# Create a polygon for the roof base
vs.Poly(*roof_vertices)
poly_h = vs.LNewObj()
# Create a pitched roof using the polygon as the base
hroof = vs.CreateRoof(False,0,0,0,0)
num = vs.GetVertNum(poly_h)
for i in range(num):
i = i+1
vertex = vs.GetPolylineVertex(poly_h,i)[0]
slope=30
eave_overhang=500
eave_height=3000
vs.AppendRoofEdge(hroof, vertex, slope, eave_overhang, eave_height)
bearingInsetDistance = 10
roof_thickness=300
vs.SetRoofAttributes(hroof, False, bearingInsetDistance, roof_thickness, 1, 0) # error after excuting this line
vs.SetClass(hroof, "Roofs")