Shape: methods to return number of properties and all properties

Hi, Matthias!

Current Shape API allows to query one property at time. It'll be great to have method to return number of properties and all properties as dict to simplify code that handle them: to skip shapes without properties and reduce number of Python-C++ transfers.

Comments

  • edited October 2020

    This is what "prop_id" is for. It can be used to retrieve the full property set via the layout:

      # gets a list of key/value pairs (list of two-element lists)
      props = layout.properties(shape.prop_id)
    
      # you can create a dict from this list like here:
      d = dict(props)
    
  • Hi, Matthias!

    Thank you for explanations!

Sign In or Register to comment.