Oops, your profile's looking a bit empty! To help us tailor your experience, please fill in key details like your SketchUp version, skill level, operating system, and more. Update and save your info on your profile page today!
π£οΈ Road Profile Builder | Generate roads, curbs and pavements easily Download
Detect object intersect
-
Hello everyone
mod = Sketchup.active_model
ent = mod.entities
grp = ent.grep(Sketchup::ComponentInstance)
for i in 0...grp.length - 1
grp.each{ |g| next if g == grp[i]
bb = Geom::BoundingBox.new.add(g.bounds.intersect(grp[i].bounds))
if bb.valid?
puts "#{g.name.to_s} and #{grp[i].name.to_s} intersect"
else
puts "#{g.name.to_s} and #{grp[i].name.to_s} do not intersect"
end
bb.clear
}
endI want to know how to calculate the model of dynamic properties of all objects (such as "Lenx", "Leny" ,"Lenz"...etc) after the object intersected the other object.
The case description like this:
First, detect all objects intersect situations like the above code
Second, if name = "column" objects intersect name = "beam" objects(just a simple example)
then, "column" objects dynamic properties("Lenx") deduction "beam" objects dynamic properties("Leny")Thank you for your advice and help

Advertisement