sketchucation logo sketchucation
    • Login
    πŸ€‘ SketchPlus 1.3 | 44 Tools for $15 until June 20th Buy Now

    Shorter version for this ruby line

    Scheduled Pinned Locked Moved Plugins
    3 Posts 3 Posters 176 Views 3 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.
    • K Offline
      ktkoh
      last edited by

      I am rewriting my wood joint scripts and was wanting to know if there is a shorthand version of this command

      cface=codef.entities.add_face @pt[0],@pt[1],@pt[2],@pt[3],@pt[4],@pt[5],@pt[6],@pt[7],@pt[8],@pt[9],@pt[10],@pt[11]
      

      Keith

      1 Reply Last reply Reply Quote 0
      • TIGT Offline
        TIG Moderator
        last edited by

        @ktkoh said:

        I am rewriting my wood joint scripts and was wanting to know if there is a shorthand version of this command

        cface=codef.entities.add_face @pt[0],@pt[1],@pt[2],@pt[3],@pt[4],@pt[5],@pt[6],@pt[7],@pt[8],@pt[9],@pt[10],@pt[11]
        

        Keith
        Use

        cface=codef.entities.add_face(@pt)
        

        It can take an array, you don't need to pass each element of the array separately πŸ˜’
        Of course the points have to be in the array in the right order - as it seems you have here...

        TIG

        1 Reply Last reply Reply Quote 0
        • A Offline
          Aerilius
          last edited by

          Try:

              cface=codef.entities.add_face(@pt)
          

          It's good that the API allows both ways...
          entities.add_face(pt1, pt2, pt3, ...)
          entities.add_face([pt1, pt2, pt3,...])

          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