.edges returns a face
-
I can't figure this one out. Here's the output from the Ruby Console:
back
#Sketchup::Face:0x1cbbfe74
back.edges.each{|e| puts e}
#Sketchup::Edge:0x1cbc1850
#Sketchup::Edge:0x1cbc1a1c
#Sketchup::Face:0x1cbcfc84
#Sketchup::Edge:0x1cbc0cc0
[#Sketchup::Edge:0x1cbc1850, #Sketchup::Edge:0x1cbc1a1c, #Sketchup::Face:0x1cbcfc84, #Sketchup::Edge:0x1cbc0cc0]How can the .edges method return a Face?
-
BUT
face.edges
doesn't return a face, it does return an array of edges.
face=Sketchup.active_model.selection[0] #<Sketchup::Face:0xef75e64> face.edges [#<Sketchup::Edge:0xf0a8b10>, #<Sketchup::Edge:0xef75e78>, #<Sketchup::Edge:0xf0a8c28>]
or
face.edges.each{|e|puts e} #<Sketchup::Edge:0xf0a8b10> #<Sketchup::Edge:0xef75e78> #<Sketchup::Edge:0xf0a8c28> [#<Sketchup::Edge:0xf0a8b10>, #<Sketchup::Edge:0xef75e78>, #<Sketchup::Edge:0xf0a8c28>]
Are you using the standard Ruby Console ?
Do you have any other tools that might ill-advisedly mess with the base-classes likeSketchup::Face
?
Your installation is most likely 'broken'
Have you considered reinstalling ? -
@tig said:
BUT
face.edges
doesn't return a face, it does return an array of edges.
face=Sketchup.active_model.selection[0] #<Sketchup::Face:0xef75e64> face.edges [#<Sketchup::Edge:0xf0a8b10>, #<Sketchup::Edge:0xef75e78>, #<Sketchup::Edge:0xf0a8c28>]
or
face.edges.each{|e|puts e} #<Sketchup::Edge:0xf0a8b10> #<Sketchup::Edge:0xef75e78> #<Sketchup::Edge:0xf0a8c28> [#<Sketchup::Edge:0xf0a8b10>, #<Sketchup::Edge:0xef75e78>, #<Sketchup::Edge:0xf0a8c28>]
Are you using the standard Ruby Console ?
Do you have any other tools that might ill-advisedly mess with the base-classes likeSketchup::Face
?
Your installation is most likely 'broken'
Have you considered reinstalling ?Yes, it's the standard Ruby Console.
No, I have no other tools that mess with the base-class.
I'll re-install and see what happens.
Thx for the feedback. -
I'd be interested in seeing the model (or portion of) to see if it can be reproduced.
-
Tim, are you really still using SketchUp 8.0.4810 ??
-
I reinstalled SU and the problem went away, so it looks like TIG was correct. I'll have to check my backups to see what version of SU was running (it would have been current, though). The profile info was obsolete.
-
I did see something like that once before - I had a plugin that traced faces and did something like:
face.edges.each do |e|
do something with an edge
end
... and every once in 10,000 faces, I'd see something like you're describing, although I could never reproduce it on command. This was with SU 7.0. I never found a fix - just found another way to execute the plugin.
-
@kwalkerman said:
I never found a fix - just found another way to execute the plugin.
Likely:
face.edges.each do |e| next unless e.is_a?(Sketchup;;Edge) # do something with an edge end
-
Dan - the bug came immediately after:
if e.is_a? Sketchup::Edge
... it was very strange, and as I said, happened once in a great while - I couldn't figure out how to make it happen on command.
Advertisement