Results 1 to 6 of 6
  1. #1
    Join Date
    Jan 2007
    Location
    San Marcos, CA
    Posts
    6,805

    Initializing Floor Area Ruby Global Variables

    I've found an interesting way of initializing a Global Variable in Ruby for the Floor Area of each Floor.

    The "LIVING AREA" Label for each Floor contains a Ruby Attribute standard_area but we can't reference the Label with a Text Block so I tried something different.

    I created a Text Macro:

    macro name = Area - First Floor
    context = Owner
    contents: $Area_first_floor = standard_area

    I then selected the LIVING AREA Label and selected the "Area - First Floor" macro in the Text Macro Management dbx. This set the value of $Area_first_floor which is saved with the Plan.

    This was really very unexpected but it opens up some capabilities for Site Analysis that I had not realized was possible.

    This can actually be done for any Room so it's really very flexible. The key is having as many of these Macros and Global Variables as you need.
    Joseph P. Carrick, Architect - AIA
    ASUS M51AC Desktop, core i7-4770 CPU @3.4 GHZ, 16 GB Ram, NVidea GT640 with60M with 3GB GM, 30" HiRes (2560/1600) Monitor , (2) 24" ASUS Monitors
    Windows 8.1
    Chief Architect 9, 10, X1, X3, X4 Premium, X5 Premium, X6 Premium

  2. #2
    Join Date
    Oct 2009
    Posts
    904
    This only works because you "selected" the "living area" object, which makes its attributes available to ruby, which you can do for any object that has ruby attributes. In the case, apparently "living area" is programed as a room ( you can do the same with building perimeter, which is just another room) However, there's no way to auto select this object since it has no label and the ref box will not reference it. Strictly a manual operation, so not sure this is any advantage over just typing in the info into global.

    But another area we need access to?
    Gerry

    NewCraft Home Services

    Design/ Compliance Review
    PE, X6 , Sketchup 8, TurboCad Pro 20
    -----------------------------------
    ASUS P9X79D, i7-3820, GTX680 w/4gb
    -----------------------------
    If the Government would just cut down more d*** trees, I'd have a much better view of the forest.

  3. #3
    Join Date
    Jan 2007
    Location
    San Marcos, CA
    Posts
    6,805
    Gerry,

    I also found that the standard_area and internal_area seem to be synonymous and unfortunately Global. So if you select another the 1st Floor LIVING AREA Label to initialize one variable and then do the same for the 2nd Floor the variable that you set for the 1st Floor gets reset.

    Is it possible to "Clone" a variable so that the link is broken? I don't have my Ruby docs with me so I'm guessing it's possible but I need the method.
    Joseph P. Carrick, Architect - AIA
    ASUS M51AC Desktop, core i7-4770 CPU @3.4 GHZ, 16 GB Ram, NVidea GT640 with60M with 3GB GM, 30" HiRes (2560/1600) Monitor , (2) 24" ASUS Monitors
    Windows 8.1
    Chief Architect 9, 10, X1, X3, X4 Premium, X5 Premium, X6 Premium

  4. #4
    Join Date
    Oct 2009
    Posts
    904
    I haven't had much success with that. Supposedly, dup makes a shallow copy and clone a deep copy. But its seems they both work the same (shallow) -- Don't know what I'm doing wrong. Perhaps the GC is following some path? But with a shallow only the ref is copied and when that is destroyed, as in object De-selected both die. only thing that would work here would be Marshalling but that is an extension which Chief does not permit.

    Its seems that Chief went to considerable time and expense to make Ruby impractical.
    Gerry

    NewCraft Home Services

    Design/ Compliance Review
    PE, X6 , Sketchup 8, TurboCad Pro 20
    -----------------------------------
    ASUS P9X79D, i7-3820, GTX680 w/4gb
    -----------------------------
    If the Government would just cut down more d*** trees, I'd have a much better view of the forest.

  5. #5
    Join Date
    Oct 2009
    Posts
    904
    Thinking about this some more -- Clone can't work because the Ruby macros (class) do not contain any instance variables -- only accessor methods. Once a object is de-selected, there's nothing to access. So copying a method gives you nothing. Only thing that would work is a one for one copy to Global while the object is selected. But you would have to manually code a ID for every object which brings you back to sq. one
    Gerry

    NewCraft Home Services

    Design/ Compliance Review
    PE, X6 , Sketchup 8, TurboCad Pro 20
    -----------------------------------
    ASUS P9X79D, i7-3820, GTX680 w/4gb
    -----------------------------
    If the Government would just cut down more d*** trees, I'd have a much better view of the forest.

  6. #6
    Join Date
    Jan 2007
    Location
    San Marcos, CA
    Posts
    6,805
    NUTS!!!!

    We need more attributes. Same as for Layout where we need page, for Plan we need level. But even then, we probably need a complete set of attributes for each floor.
    Joseph P. Carrick, Architect - AIA
    ASUS M51AC Desktop, core i7-4770 CPU @3.4 GHZ, 16 GB Ram, NVidea GT640 with60M with 3GB GM, 30" HiRes (2560/1600) Monitor , (2) 24" ASUS Monitors
    Windows 8.1
    Chief Architect 9, 10, X1, X3, X4 Premium, X5 Premium, X6 Premium

 

 

Posting Permissions

  • Login or Register to post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •