Can Sketchup execute a proc's

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”

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.

will just output the String "ang_a"


Please use correct code blocks on the forum … [How to] Post correctly formatted and colorized code on the forum?

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