• Login
sketchucation logo sketchucation
  • Login
โ„น๏ธ GoFundMe | Our friend Gus Robatto needs some help in a challenging time Learn More

Need Help adding predefined dynamic Attributes via Ruby

Scheduled Pinned Locked Moved Developers' Forum
5 Posts 3 Posters 904 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 4 Dec 2016, 18:00

    Hello To all !! ๐Ÿ˜‰
    I am trying to create a useful Plugin for creating a simple Box
    in Ruby via User Input, then storing the Input Informations to the "dynamic_attributes"
    Dictionary.

    As a starting-Point I took the Box.rb from the Examples-Plugin and extended it
    a little.

    So far everything worked beautifully, since there are Heaps of Example-Code
    for this type of task and any Custom Attribute (info) that I store seems to be showing too.

    However,what I would like to do now is to manually add the LenX, LenY and LenZ Attributes
    to the Component (with Ruby) without setting a fixed Value aka "=Value" so that I can benefit from all the nifty observers that take care of auto-updating the corresponding Values thru a change.

    That would be very helpful since I dont want to use the right click menu all the time
    to add LenX, LenY and LenZ to every Part that is needed and I could also continue
    to use FredoScale (one of my favs in everyday use) and at the same time get accurate results in the Report.

    Sadly I didnt find any Very useful Code that explains how to handle the Formulas
    that are used to store the actual Value of the coresponding Attributes inside the DC.
    (besides the custom ones where a few snippets can be found (Sangs Color from Scott Lininger)).

    Any Help would be very appreciated since I am starting to get crazy over this.

    PS: I Apologise for my Bad English and I am Hoping anyone can help

    1 Reply Last reply Reply Quote 0
    • J Offline
      Jim
      last edited by 4 Dec 2016, 21:26

      Download some Dynamic components from the 3D Warehouse and inspect their "dynamic_attributes" dictionaries.

      Hi

      1 Reply Last reply Reply Quote 0
      • D Offline
        Dan Rathbun
        last edited by 6 Dec 2016, 15:33

        ... using:
        http://extensions.sketchup.com/en/content/attribute-inspector

        And see this wiki thread in the official forums:

        • Dynamic Components Resources

        I'm not here much anymore.

        1 Reply Last reply Reply Quote 0
        • J Offline
          JH
          last edited by 14 Dec 2016, 15:22

          Thank You very mouch for the Info,
          I didnt know that there is a plugin that shows the normally hidden
          Attributes.

          Very useful, I guess I got some homework to do now ๐Ÿ˜‰

          1 Reply Last reply Reply Quote 0
          • J Offline
            JH
            last edited by 15 Dec 2016, 17:02

            Allright, Got it partly working, ๐Ÿ˜„

            But I Cant get the Attribute-Inspectors to show the
            Values, I guess I dont really understand how
            to set the Formulas correctly to get the corresponding Values by now.

            The DC Browser shows the Values (Lengths of the Piece in X,Y and Z)
            but everything else does not, this means no reporting so far.

            Can anybody push me a little in the right Direction โ“

            Where do I have to set the DC Attributes Instance or Definition?
            and how could I set it to both if needed?

            I tried to set it to the Definition and the second time I run the Script
            the created Geometry has no Attributes at all, or at least nothing
            important.


            The unfinished Script, still buggy

            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