ΠžΡ„ΠΈΡ†ΠΈΠ°Π»ΡŒΠ½Ρ‹ΠΉ Π΄ΠΈΡΡ‚Ρ€ΠΈΠ±ΡŒΡŽΡ‚ΠΎΡ€ ΠΊΠΎΠΌΠΏΠ°Π½ΠΈΠΈ Launch Π² России

+7 (495) 565-30-91
+7 (495) 565-30-87

ΠœΡ‹ Ρ€Π°Π±ΠΎΡ‚Π°Π΅ΠΌ с 09:00 Π΄ΠΎ 18:00

Π”Π½ΠΈ Ρ€Π°Π±ΠΎΡ‚Ρ‹

Россия 115162, г. Москва,
ΡƒΠ». Π₯авская, Π΄. 3
Как ΠΏΡ€ΠΎΠ΅Ρ…Π°Ρ‚ΡŒ

09:00 Π΄ΠΎ 18:00

+7 Β (495) 565-30-91 +7 Β (495) 565-30-87

Sketchup 21.0.0 🎯 ✨

size_t count = 0; SUEntitiesGetNumSelected(entities, &count);

model = face.model model.start_operation("Extrude", true) normal = face.normal offset_vector = normal.clone offset_vector.length = distance # Extrude: copy face, move it, then create side faces new_face = face.entities.add_face(face.vertices) new_face.material = face.material # Move the new face tr = Geom::Transformation.translation(offset_vector) new_face.transform!(tr) # Create side faces (simple version) face.loops.each do |loop| edges = loop.edges edges.each do |edge| v1 = edge.start.position v2 = edge.end.position v1_new = v1 + offset_vector v2_new = v2 + offset_vector face.entities.add_face(v1, v2, v2_new, v1_new) end end model.commit_operation end end unless file_loaded?( FILE ) cmd = UI::Command.new("Extrude by 10cm") do model = Sketchup.active_model sel = model.selection if sel.first.is_a?(Sketchup::Face) MyTools::ExtrudeByDistance.extrude(sel.first, 10.cm) else UI.messagebox("Select a single face") end end cmd.tooltip = "Extrude selected face" UI.menu("Plugins").add_item(cmd) file_loaded( FILE ) end end sketchup 21.0.0

Load in SketchUp: Extensions > Ruby Console > File > Open or paste code. This requires the SDK. A minimal main.cpp for a command that prints selection count: size_t count = 0