Skip to main content

Hello,

Is there a programmatic way of knowing when the shape selection has changed?

I have a right context in my package and custom shapes.  My custom shapes have a  custom data property on it called q_type.  What I want to do is:

  1. Click open the right click context panel.  Keep it open.
  2. Select Shape1 which has a custom data property “q_type” value of “foo”.  Show the “foo” form in the right click panel.  
  3. User now selects Shape2 which has a custom data property “q_type” value of “bar”.  Show the “bar” form.

In my extension app, can I register a method to a on selection changed event?

Thanks, Dan

Hello PromitaDan,

 

We are reviewing your question now and will be in touch with something soon.


Take a look at https://developer.lucid.co/extension-sdk/#classes_ui_viewport-Viewport_hookselection.  I think that gives you what you need.


This is exactly what I need.  I actually read the documentation for viewport and missed this method.

I added it to my extension.ts file.  do i need to unhook it and if so, what is the approach?


Hello again,

You do not need to unhook the selection as the extension framework handles disposing it for you.  However, if you no longer needed the functionality and wanted to remove it yourself, you could via https://developer.lucid.co/extension-sdk/#classes_ui_viewport-Viewport_unhookselection


Reply