• Login
sketchucation logo sketchucation
  • Login
⚠️ Libfredo 15.4b | Minor release with bugfixes and improvements Update

Creating Arcs: Interesting Problem, why?

Scheduled Pinned Locked Moved Extensions & Applications Discussions
extensions
3 Posts 3 Posters 883 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 15 May 2016, 00:10

    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 15 May 2016, 02:44

      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
      • S Offline
        sdmitch
        last edited by 15 May 2016, 16:15

        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
        • 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