Can Sketchup execute a proc's


#1

Default code, use or delete…

mod = Sketchup.active_model # Open model
ent = mod.entities # All entities in model
sel = mod.selection # Current selection

ang_a = proc.new {|d,f| d * f }

ang_a.call(3 ,4)

puts “ang_a”


#2

I’m not the proper person to answer this question, but if you follow the Ruby syntax, it seems to work okay. Try using something like:

mod = Sketchup.active_model # Open model
ent = mod.entities # All entities in model
sel = mod.selection # Current selection
ang_a = proc {|d,f| d * f } # Create procedure
puts ang_a.call(3 ,4) # Output result

This gives me “12” in the Console.


#3

will just output the String "ang_a"


Please use correct code blocks on the forum … [How to] Colourize code on the forum? (wiki)


#4

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.