Entity and Vertex
-
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 Vertexif 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)
-
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.
-
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.
-
What is it you are trying to do?
-
@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?
-
#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
-
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.
Advertisement