sketchucation logo sketchucation
    • Login
    ℹ️ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info

    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

      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
      • thomthomT Offline
        thomthom
        last edited by

        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

          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
          • thomthomT Offline
            thomthom
            last edited by

            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
            • thomthomT Offline
              thomthom
              last edited by

              @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

                		#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

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

                  Advertisement