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

    Need Help adding predefined dynamic Attributes via Ruby

    Scheduled Pinned Locked Moved Developers' Forum
    5 Posts 3 Posters 904 Views 3 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 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

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

        Hi

        1 Reply Last reply Reply Quote 0
        • Dan RathbunD Offline
          Dan Rathbun
          last edited by

          ... 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
          • JHJ Offline
            JH
            last edited by

            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
            • JHJ Offline
              JH
              last edited by

              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