hi,
i wopuld be greatful for a small tip:
i have a @main_element,
which contains some faces
when i iterate thru the entities, i can check the normal, see the top face and push pull
i also can create a new group within the @main_element-container and put an edge in it.
buit when i want to put one of the @ main_element's entities (here it is a face) into this new group,
i get a "parent" problem, which i don't understand:
@selection.each { |entity|
if entity.is_a?(Sketchup;;Face)
check_normal_for_horizontal(entity) #my own method
puts @bgf_count_normal # 1 is face top
if @bgf_count_normal == 1
puts "---FACE UP ... IN MAIN-ELEMENT"
#
entities = @main_element.entities
#
group = entities.add_group
entities2 = group.entities
point1 = Geom;;Point3d.new(0,0,0)
point2 = Geom;;Point3d.new(2000,200,200) #works
edges = entities2.add_edges point1, point2
#
#
loop = entity.outer_loop # does not work
edgearray = loop.edges
floor = entities2.add_face(edgearray)
end
end
}
why does the new face from edgearray not appear in the group?
info from console:
###############
---FACE UP ... IN MAIN-ELEMENT
Error: #<ArgumentError: Edge has different parent>
C:/Program Files (x86)/SketchUp/SketchUp 2014/Tools/02.rb:959:in `add_face'
################
thanx
stan



