• Login
sketchucation logo sketchucation
  • Login
🔌 Quick Selection | Try Didier Bur's reworked classic extension that supercharges selections in SketchUp Download

Entity and Vertex

Scheduled Pinned Locked Moved Developers' Forum
7 Posts 2 Posters 546 Views 2 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
    dany67300
    last edited by 9 Sept 2010, 14:47

    Hi everybody,

    for my first message, I've got a problem in Sketchup and Ruby.
    I'm trying to modify some Vertex position, I access them through the vertices method in the edges, so myVertex is a Vertex

    				
    if myVertex.is_a?(Sketchup;;Vertex)
         puts "Vertex"
         if myVertex.is_a?(Sketchup;;Entity)
              puts "Entity"
         end
    end
    			
    if myVertex.is_a?(Sketchup;;Entity)
         Sketchup.active_model.selection.add myVertex
    end
    
    

    this show me in the ruby console :

    Vertex
    Entity
    Error; #<TypeError; wrong argument type (expected Sketchup;;Entity or Array of Sketchup;;Entity)>
    
    

    when i try to add it to the selection.
    so I've got a Vertex which is an Entity, and it says me that it's not an Entity (with the error)

    Can somebody explain me this symptom please ?
    thanks

    (sorry for my english)

    1 Reply Last reply Reply Quote 0
    • T Offline
      thomthom
      last edited by 9 Sept 2010, 15:16

      Technically a Vertex is an Entity, but SketchUp can't select vertices - it does not have such a feature.
      It's why I made Vertex Tools.

      That error message you got simply isn't accurate enough.

      Thomas Thomassen — SketchUp Monkey & Coding addict
      List of my plugins and link to the CookieWare fund

      1 Reply Last reply Reply Quote 0
      • D Offline
        dany67300
        last edited by 10 Sept 2010, 09:58

        ok thank you for your fast answer.

        I'll try to fit my needs into antoher way, your Vertex Tools looks great, but it isn't adapted for me.

        1 Reply Last reply Reply Quote 0
        • T Offline
          thomthom
          last edited by 10 Sept 2010, 11:06

          What is it you are trying to do?

          Thomas Thomassen — SketchUp Monkey & Coding addict
          List of my plugins and link to the CookieWare fund

          1 Reply Last reply Reply Quote 0
          • T Offline
            thomthom
            last edited by 10 Sept 2010, 11:12

            @dany67300 said:

            I just wanted to put the vertex in the selection for drawing considerations, but I'll do it in an other way.

            For that you can use the Tool class, just draw an indicator of the vertex you are manipulating.

            @dany67300 said:

            For the moment, I'm trying to found a memory leak when I try to send my mouse coordinates to a Webdialog for displaying it using the InputPoint class and the position method. It takes me a lot of memory and then makes sketchup very slow.

            This is odd - do you have some sample code we can look at?

            Thomas Thomassen — SketchUp Monkey & Coding addict
            List of my plugins and link to the CookieWare fund

            1 Reply Last reply Reply Quote 0
            • D Offline
              dany67300
              last edited by 10 Sept 2010, 12:00

              		#quand on bouge la souris
              		def onMouseMove(flags, x, y, view)   
              			#mise à jour du point deplace
              			@input.pick view, x, y	
              			
              			update
              			
              			view.invalidate
              		end
              		
              		def update
              			pt = @input.position
              		end
              

              it looks like this with some javascript call in the update function

              but when I comment them, there is still the leak. If you move a lot your mouse, you'll see the bug

              1 Reply Last reply Reply Quote 0
              • D Offline
                dany67300
                last edited by 10 Sept 2010, 12:36

                I just wanted to put the vertex in the selection for drawing considerations, but I'll do it in an other way.

                For the moment, I'm trying to found a memory leak when I try to send my mouse coordinates to a Webdialog for displaying it using the InputPoint class and the position method. It takes me a lot of memory and then makes sketchup very slow.

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

                Advertisement