sketchucation logo sketchucation
    • Login
    ℹ️ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info

    Ruby scripted Dynamic Attributes reporting Issues

    Scheduled Pinned Locked Moved Developers' Forum
    2 Posts 2 Posters 6.2k Views 2 Watching
    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.
    • JHJ Offline
      JH
      last edited by

      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
      • Dan RathbunD Offline
        Dan Rathbun
        last edited by

        @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