• Login
sketchucation logo sketchucation
  • Login
🤑 SketchPlus 1.3 | 44 Tools for $15 until June 20th Buy Now

Adding a new group issues

Scheduled Pinned Locked Moved Developers' Forum
2 Posts 2 Posters 5.9k Views
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • U Offline
    UncleString
    last edited by 19 Dec 2018, 20:15

    Skecthup-Group.jpgSkecthup-Group.jpg
    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

    1 Reply Last reply Reply Quote 0
    • S Offline
      slbaumgartner
      last edited by 30 Dec 2018, 16:31

      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.

      1 Reply Last reply Reply Quote 0
      • 1 / 1
      • First post
        Last post
      Buy SketchPlus
      Buy SUbD
      Buy WrapR
      Buy eBook
      Buy Modelur
      Buy Vertex Tools
      Buy SketchCuisine
      Buy FormFonts

      Advertisement