sketchucation logo sketchucation
    • Login
    ℹ️ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info

    Adding a new group issues

    Scheduled Pinned Locked Moved Developers' Forum
    2 Posts 2 Posters 5.9k Views 2 Watching
    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

      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

        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