Jump to content

Could not create roof, probably not enough walls


Recommended Posts

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")

 

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...