Adding a new group issues
-
I am drawing a staircase using Ruby to retrieve the data from Excel.
I can get two sections drawn, but the 3rd section, it draws the lines, and makes it a group, but then it goes somewhere else to pushpull.
BTW- the white tread and the tread outline are both grouped as "bottomStairTread"
The brown extended tread is still grouped with the first top stair, it got pushpulled somehow with the below code.This is the code for the second stair tread
group = Sketchup.active_model.entities.add_group ; group.name="bottomStairTread" ent2 = group.entities ent2.add_line [start1-1.5,start2,start3+rise-c], [start1-(run+1),start2,start3+rise-c] #run+1.5=riser thickness + nose ent2.add_line [start1-1.5,start2,start3+rise-c], [start1-1.5,start2,start3+rise-c+dado] ent2.add_line [start1-1,start2,start3+rise-c+dado], [ start1-1.5,start2,start3+rise-c+dado] ent2.add_line [start1-1,start2,start3+rise-c+dado], [ start1-1,start2,start3+rise-c] ent2.add_line [start1-1,start2,start3+rise-c], [ start1,start2,start3+rise-c] ent2.add_line [start1,start2,start3+rise-c], [ start1,start2,start3+rise] ent2.add_line [start1,start2,start3+rise], [ start1-(run+1),start2,start3+rise] ent2.add_line [start1-(run+1),start2,start3+rise], [start1-(run+1),start2,start3+rise-c] edg.find_faces; face=edg.faces[0] face.pushpull wdth-(g*2) group = ent2.add_group face.all_connected ;group.name="bottomStairTread" group.description="bottomStairTread"
How do I make it find faces & pushpull for this section?thanks
-
Your snippet is missing some key contextual info from the surrounding code: where was edg created and what does it refer to? Lacking that, it is impossible to guess what face=edg.faces[0] returns, hence what pushpull is acting on.
Advertisement