• Login
sketchucation logo sketchucation
  • Login
ℹ️ GoFundMe | Our friend Gus Robatto needs some help in a challenging time Learn More

Ruby scripted Dynamic Attributes reporting Issues

Scheduled Pinned Locked Moved Developers' Forum
2 Posts 2 Posters 6.2k Views
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    JH
    last edited by 12 Feb 2019, 16:20

    Hello to Everyone,

    In 2016 I began to script a little tool to create some Dynamic Components,
    with added Information, for Edgebanding and different Materials,
    In the first Iteration I just made a cube, which was then changed thru the
    DC Component options to the needed Size, that worked as expected.

    Recently I took a look at the Code and changed it, that the drawn Cube has the
    right Size, as the User has to put them in an Inputbox-Prompt,
    The Components are created using the Point-Method and then Pushpulled (in Ruby).

    However, I dont get it why I cannot get the lenx, leny and leny to report in any
    Ruby- driven Report-Script I tried, until some User-Interaction with the
    Component-Options has been made,
    (just clicking in the Inputbox of the DC-Settings-Dialog and applying the already correct Values)
    since the Original Report-Feature can report these Values without this User-Interaction.

    As far as I can see, the Variables are correctly set, since the DCs are working
    as they should besides the Reporting-Thing.

    attached is a drawing with some of the scripted Components

    Has anyone a clue how I can make them readable to a script?

    Thank you in advance!


    script generated Components

    1 Reply Last reply Reply Quote 0
    • D Offline
      Dan Rathbun
      last edited by 23 Mar 2019, 21:52

      @jh said:

      ... I dont get it why I cannot get the lenx, leny and leny to report in any
      Ruby- driven Report-Script I tried, until some User-Interaction with the
      Component-Options has been made, ...

      The default values are stored in the DC definition's "dynamic_attributes" dictionary and the DC instance just uses the defaults until the user changes them. When they are different than the default, the DC code will create instance specific attributes in the instance's "dynamic_attributes" dictionary.

      So the "rule of thumb" for Ruby coding DCs is to always first check the instance's "dynamic_attributes" dictionary, then check the definition's "dynamic_attributes" dictionary for dynamic attribute values.

      I'm not here much anymore.

      1 Reply Last reply Reply Quote 0
      • 1 / 1
      • First post
        Last post
      Buy SketchPlus
      Buy SUbD
      Buy WrapR
      Buy eBook
      Buy Modelur
      Buy Vertex Tools
      Buy SketchCuisine
      Buy FormFonts

      Advertisement