sketchucation logo sketchucation
    • Login
    Oops, your profile's looking a bit empty! To help us tailor your experience, please fill in key details like your SketchUp version, skill level, operating system, and more. Update and save your info on your profile page today!
    FredoBend | Powerful new bending tool for SketchUp Download

    Creating Arcs: Interesting Problem, why?

    Scheduled Pinned Locked Moved Extensions & Applications Discussions
    extensions
    3 Posts 3 Posters 974 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.
    • D Offline
      designer7777
      last edited by

      I'm creating a few arcs, as will be shown in the example pic, with this code:

      c1 = Pt(0) 'cen
      r1 = Pt(1) 'rad
      sa = Pt(2) 
      ea = Pt(3)
      
      
      wshShell.SendKeys "centerpoint = Geom;;Point3d.new" & "{(}" & c1 & "{)}" & vbCr
      wshShell.SendKeys "vector = Geom;;Vector3d.new 0,0,1" & vbCr
      wshShell.SendKeys "vector2 = Geom;;Vector3d.new 1,0,0" & vbCr
      
      wshShell.SendKeys "vector3 = vector.normalize!" & vbCr
      wshShell.SendKeys "model = Sketchup.active_model" & vbCr
      wshShell.SendKeys "entities = model.active_entities" & vbCr
      wshShell.SendKeys "edges = entities.add_arc " & "centerpoint," & "vector2, vector3," & r1 & "," & sa & "," & ea & vbCr
      

      (That code runs through 4 arcs in an array, pt changing per entity to be created.)

      The oddity is, a certain arc wants to reverse the orientation, all driven from the same code, all in the same overall loop of points. Just

      one arc does this, all the time. Same problem if I reverse the sa and ea.

      http://s20.postimg.org/rqcatc2zh/SU_ARC_Q.jpg

      Any idea why this is happening?

      Thanks

      1 Reply Last reply Reply Quote 0
      • D Offline
        driven
        last edited by

        does it work if just use ruby?

        john

        learn from the mistakes of others, you may not live long enough to make them all yourself...

        1 Reply Last reply Reply Quote 0
        • sdmitchS Offline
          sdmitch
          last edited by

          sa and ea should be angles not points in the .add_arc arguments.

          calculate the arc normal

          vector3=c1.vector_to(sa)*c1.vector_to(ea)
          

          Nothing is worthless, it can always be used as a bad example.

          http://sdmitch.blogspot.com/

          1 Reply Last reply Reply Quote 0

          Hello! It looks like you're interested in this conversation, but you don't have an account yet.

          Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

          With your input, this post could be even better đź’—

          Register Login
          • 1 / 1
          • First post
            Last post
          Buy SketchPlus
          Buy SUbD
          Buy WrapR
          Buy eBook
          Buy Modelur
          Buy Vertex Tools
          Buy SketchCuisine
          Buy FormFonts

          Advertisement