ge25yak Posted April 29 Share Posted April 29 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") Quote Link to comment
Gelde-Aart Posted May 6 Share Posted May 6 Hi ge25yak, Your roof_vertices list should be counter clockwise: roof_vertices = [(0, 0), (5000, 0), (5000, 3000), (0, 3000)] Don't ask me why... Quote Link to comment
Recommended Posts
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.