Detect if shape is selected

edited February 2015 in Ruby Scripting

Hi,

I can iterate over selected shapes like this:

layout_view.each_object_selected { |sel| ... }

However how do I detect if a given object (shape or cell) is selected? I don't see an .is_selected? method.

Thanks,
David

Comments

  • edited November -1

    Hi David,

    that is not possible and there is a reason for this: a selection is not just a shape or instance. It is a shape or instance plus an instantiation path. That means, a shape cannot know by itself whether it is selected or not, because it might be selected in one instance, but not in other instances.

    Matthias

Sign In or Register to comment.