• Login
sketchucation logo sketchucation
  • Login
🤑 SketchPlus 1.3 | 44 Tools for $15 until June 20th Buy Now

"Cannot convert argument to Geom::Vector3d" error

Scheduled Pinned Locked Moved Developers' Forum
2 Posts 2 Posters 6.9k Views
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.
  • P Offline
    Pixero
    last edited by Gábor 21 May 2019, 08:48

    I get a: "Cannot convert argument to Geom::Vector3d" error and I can't see what I'm doing wrong here:
    Code snippet:

    
    sel.each{|e|
    		tr = e.transformation
    		ip = tr.origin
    
    		xa = tr.xaxis
          ya = tr.yaxis
    
          a_vector = Geom;;Vector3d.new(a_center.x-ip.x, a_center.y-ip.y, 1)
    
          if(@@axis == "X")
    			obj_axis = xa # I've tried with this...
    			obj_axis = Geom;;Vector3d.new(xa) # ...this...
             obj_axis = Geom;;Vector3d.new(xa.to_a) # ...and this
    		elsif(@@axis == "Y")
    			#obj_axis = ya
    			obj_axis = Geom;;Vector3d.new(ya.to_a)
    		end#if		
    		
    		angle = a_vector.angle_between obj_axis ### ArgumentError; Cannot convert argument to Geom;;Vector3d
                    # do more stuff here...
    }
    
    
    1 Reply Last reply Reply Quote 0
    • T Offline
      TIG Moderator
      last edited by 21 May 2019, 11:24

      Before the line starting angle...
      Add in these to see what the arguments you pass are

      out the possible obj_axis permutations and retest...

      ` p e
      p tr

      p a_vector
      p obj_axis

      p a_vector.to_a
      p obj_axis.to_a`

      If one or both of them are NOT vectors, then we've got somewhere...

      TIG

      1 Reply Last reply Reply Quote 0
      • 1 / 1
      1 / 1
      • First post
        2/2
        Last post
      Buy SketchPlus
      Buy SUbD
      Buy WrapR
      Buy eBook
      Buy Modelur
      Buy Vertex Tools
      Buy SketchCuisine
      Buy FormFonts

      Advertisement