• Login
sketchucation logo sketchucation
  • Login
⌛ Sale Ending | 30% Off Profile Builder 4 ends 30th September

Shorter version for this ruby line

Scheduled Pinned Locked Moved Plugins
3 Posts 3 Posters 179 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 16 Jun 2011, 11:44

    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
    • T Offline
      TIG Moderator
      last edited by 16 Jun 2011, 11:48

      @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 16 Jun 2011, 11:53

        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
        1 / 1
        • First post
          1/3
          Last post
        Buy SketchPlus
        Buy SUbD
        Buy WrapR
        Buy eBook
        Buy Modelur
        Buy Vertex Tools
        Buy SketchCuisine
        Buy FormFonts

        Advertisement