How To Make Custom Dynamic Component Attribute

Sure but variable references and dictionary attributes are not directly linked.
(In fact all dictionary attributes are stored as string text.)

So YOU need to make the link.

  1. Remove all '@' from the dictionary names, and leave the '@' prefixes on the Ruby instance variable names.

  2. Change the "_innerDiameter_label" to just "Inner Diameter"
    (the user should not need to know what the actual variable / attribute reference names are.)

  3. Use a class constant to reference the dynamic attributes dictionary name, rather than creating a bunch of identical literal string objects:

DYNDICT = 'dynamic_attributes'
  1. Then in your setAttributes() method:
theDef.set_attribute( DYNDICT, 'innerDiameter', @innerDiameter )

1 Like