CARMELHILL

Getting Ruby variables names

Recommended Posts

How do you get general Ruby variables? I know you can use a leader line and insert %ObjectProperties% to get the available variables for an object, but what about general variables like floor levels?

 

I want to create a simple text macro that will automatically place the floor joists size I am using on a particular floor level in my floor structure, into my text call out "2" x 8" floor joists @ 16" o.c." and other locations. When I get better at this Ruby stuff I want to pull that joist size directly from the floor structure definition (oh to dream - is it even possible?).

 

I wanted to create a quick list of specs that are currently used in my project on the top left of my default layout page for quick reference, like Jared Baehmer did in his video series:

https://www.chiefarchitect.com/videos/watch/1963/creating-a-successful-workflow-for-design-construction-document-production-by-jared-baehmer.html

 

FLOOR ASSEMBLY.JPG

USER VALUES.JPG

JOIST SPAN.JPG

Share this post


Link to post
Share on other sites

Edward, 

 

Here's a macro that will display all Ruby $Global Variables and their values.  Of course, for some of those you would need to have macros to set them first.  Let me know if you need help with that.  Jared has most of my macros, including those that specify framing member sizes and spacing.  They are not difficult to create and/or modify.

_Global Variable Values.json

Share this post


Link to post
Share on other sites

This may not be the answer to what you want it to do but it might get you started.  I use this as a quick way to display what is going on in the room I place this macro.  You might be able to use some parts of it.

Capture.JPG

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

  • Member Statistics

    27478
    Total Members
    6254
    Most Online
    Oilersfan20
    Newest Member
    Oilersfan20
    Joined
  • Similar Content

    • By ccarpenter18
      In X12 I've noticed that when using Structural Member Reporting in a material list, the price column in the list does not appear to be sensitive to whether a "per unit" or "per length" calculation is being performed by the material list.  In both cases, the material list appears to use the same Price variable in the Component Panel of each object.  Does anyone know of some Ruby scripting that could be used to correct this?  Off hand, I'm thinking of a macro inserted into the Price variable on the Component Panel of each structural member that would use the Material List row context to report a price that depends on how the row wants to use the Price.
    • By community
      Hello,
      Just throwing the question out here: Is it possible to write a custom script for X10 to make the program export a custom materials list with some calculated fields and some custom formatting, like a header with our logo?
      If so, would anyone have an idea where I could turn to have this done for me?
       
      Kind regards
    • By BrownTiger
      The Andersen 100 Series windows [Fiberex] are always popular with a builders. Primarily, they offer different interior and exterior colors, not as ugly as some other Vinyl... Sometimes designer want to know if he is using standard vs custom sizes [adds +$$].
       
      So here is a validator macro, that can be assigned as a label or just executed in the tmm
       

       
      Free Macro, enjoy
      Code demonstrate use of Ruby arrays, and "any?" method.
       
      BT
      I also have A200,400, and pella.. But this will get you started if you are not 100% familiar with Ruby.
      Andersen100Units.json
    • By Doug_N
      In doing some ruby stuff to automate information required by building department code examiners, so I wrote a bit of simple code
       
       
       

       
      to get this. 
       
      But I need that in an elevation, not in a plan view.  No joy it seems.  
       

       
      Anyone know why this is?
       

    • By GerryT
      Revit, Rhino, Vectorworks and Allplan all have Python support. Form-Zis working on Python. Sketchup does ruby.
       
      Although i do think that Python may integrate better, I still think Ruby is a easier language to learn for the novice. And ruby 3 will have some advanced features.
       
      Wonder where Chief is and what is their position is now? -- With a few improvements and a keyboard interface using Chief's hotkeys, I think Chief's Ruby API could quickly rival the above in versatility? Are Chiefer's going to be left behind? What do you think? Open up Data Access in CA.