Рет қаралды 2,401
Sketchup Trick for Random Push Pull #shorts #shortsyoutube #shortsvideo
Code :
module RandomPushPull
def self.perform_push_pull(selection)
Iterate over each selected entity
selection.each do |entity|
Check if the entity is a face or a group/component with a single face
next unless entity.is_a?(Sketchup::Face) || (entity.is_a?(Sketchup::Group) && entity.entities.size == 1 && entity.entities.first.is_a?(Sketchup::Face))
Calculate the random distance for push-pull operation between 20" and 90"
distance = rand(20..90)
Perform push-pull operation
entity.pushpull(distance)
end
end
end
Get the current selection
selection = Sketchup.active_model.selection