Components panel information


KilianDrafting
 Share

Go to solution Solved by Alaskan_Son,

Recommended Posts

  • Solution

Depends on exactly which data you want, but the short answer is yes.  For the example above, you can use some relatively simple code like:

upper_layers[0].material_data.quantity.to_cu_yd.round(2)

 

It gets much more complicated though if your wall has multiple layers.

Link to comment
Share on other sites

43 minutes ago, Alaskan_Son said:

Depends on exactly which data you want, but the short answer is yes.  For the example above, you can use some relatively simple code like:

upper_layers[0].material_data.quantity.to_cu_yd.round(2)

 

It gets much more complicated though if your wall has multiple layers.

Thank you! I see this would also be affected by a pony wall situation.

Link to comment
Share on other sites

  • 1 month later...
On 2/16/2026 at 8:50 AM, KilianDrafting said:

Thank you! I see this would also be affected by a pony wall situation.

Yes but if you had something you were trying to target, such as concrete, you could write a macro to search descriptions for the presense of the word "concrete" and total the areas being reported:
 

# ============================================================
# Written by Rabbitt Design
# www.rabbittdesign.net
# 2026
#
# DISCLAIMER:
# This macro is provided as-is without any guarantees of accuracy,
# completeness, or fitness for a particular purpose. Results are
# dependent on model conditions, layer definitions, and material
# assignments within Chief Architect. Users are responsible for
# verifying all outputs. Rabbitt Design assumes no liability for
# errors, omissions, or any decisions made based on this data.
# ============================================================

def concrete_area_total
  # ----------------------------------
  # CONTEXT HANDLING (owner / referenced)
  # ----------------------------------
  obj = owner rescue nil
  obj = referenced if obj.nil? || !obj.respond_to?(:upper_layers)

  return nil unless obj && obj.respond_to?(:upper_layers)

  total = nil

  [obj.upper_layers, obj.lower_layers].each do |layers|
    next unless layers.respond_to?(:each)

    layers.each do |layer|
      begin
        next unless layer

        mat = layer.material_data
        next unless mat && mat.description

        if mat.description.downcase.include?("concrete")
          area = layer.area
          next unless area

          total = total ? total + area : area
        end

      rescue
        # silent fail
      end
    end
  end

  total
end

concrete_area_total

 

Edited by Renerabbitt
Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share