ChiefArmstrong

Chief Architect
  • Posts

    12
  • Joined

Reputation

16 Good

About ChiefArmstrong

Profile Information

  • Gender
    Male
  • Location
    Coeur d' Alene, ID, USA

Recent Profile Visitors

1753 profile views
  1. Good Afternoon all, Yesterday I shared a user defined macro with the Advanced 2 class at Chief Academy. I promised that I would share it on ChiefTalk, so here it is. I shared this example for two reasons, The first was that I wanted to demonstrate how to use the NumberFormatter class that we have provided in Chief. You can read more about NumberFormatter in the section title "Measurement and NumberFormatter Classes" in the Chief Architect Premier X16 Reference Manual. The other purpose for sharing this macro was to demonstrate a technique for creating user defined macros that can accept input. This technique makes use of a Ruby construct called a Proc. I am attaching a file that you can import into chief. The first macro in that file is format_ft_in: Proc.new { |val| formatter = NumberFormatter.new formatter.unit = "'-\"" formatter.use_fractions = true formatter.apply val } The other macro is format_sq_ft: Proc.new { |val| formatter = NumberFormatter.new formatter.unit = 'ft²' formatter.decimal_places = 2 formatter.apply val } These macros aren't very helpful if you use something like "%format_ft_in%" all by itself. Here is an example of how to use it. I included this text in the label for a slab: Thickness: %macros.format_ft_in.call(thickness)% Perimeter: %macros.format_ft_in.call(perimeter)% Area: %macros.format_sq_ft.call(area)% The attached image shows the results: The primary advantage of this technique is that with a single macro I can format any linear measurement. I this case I am able to use "format_ft_in" for both the thickness and perimeter of the slab. Furthermore, I could apply it to the length of a wall, the width of a cabinet, the height of a window, etc. Similarly "format_sq_ft" could be used for any area measurement. I hope these macros are helpful to a few of you. I know that some of you can improve on this technique further. I would love to see what you come up with. NumberFormatter and Proc.json
  2. Select and open the exterior room on each floor and add a component like what is shown below.
  3. By default the backsplash component is based on the automatic_countertop. If you add a new component using the little green plus button it will be based on the cabinet itself. You should be able to compute the area using the formula shown in the image below.
  4. This is working for me: Select the entire price column in excel and copy it In the master list select the price cell in row 1, not the entire column Paste
  5. Currently the best you can do is copy and paste. If the rows in your Excel spreadsheet match the rows in your master list you could copy the price column from excel and paste it into your master list. Be careful, the rows have to match exactly.
  6. I noticed an issue with my initial post. I have edit it to correct the issue.
  7. Rene's suggestion is a good one and is probably the best approach for most things in the materials list. If that isn't sufficient, there is a straightforward way to do this exactly the way you described using user defined macros with a little bit of Ruby code. I have attached a file with some simple user defined macros that should do the trick. As always, when it comes to writing macros there are multiple ways to get things done. This is just one approach, and I figured I would use this opportunity to illustrate some of what is possible using Chief and Ruby. Each of these macros is an Evaluated macro using None for the context. I have included the full text of each macro below for your convenience. eave_depth is the exact method you described of estimating the depth of the eave. One drawback to this method is that it will have a tendency to underestimate the depth of the eave for a hip roof. eave_depth owner.projected_overhang_area / owner.eave_fascia_length select_hardie_soffit_size is where most of the magic happens. In my implementation I am using a Hash to store all 3 dimensions of the soffit material. Here I am taking advantage of one of the extensions to the ruby language used by chief. in particular, adding .in, or .ft to the end of a number makes it a Measurement which is helpful in making sure that you are working with the correct units. Another thing to note for anyone new to macros is the ability to use macros. to reuse the functionality of one macro inside another. select_hardie_soffit_size result = Hash.new result[:thick] = 0.25.in eave_depth = macros.eave_depth if eave_depth <= 0.in elsif eave_depth <= 12.in result[:depth] = 12.in result[:length] = 12.ft result elsif eave_depth <= 16.in result[:depth] = 16.in result[:length] = 12.ft result elsif eave_depth <= 24.in result[:depth] = 16.in result[:length] = 8.ft end result The final two macros make use of select_hardie_soffit_size to generate the size text... hardie_soffit_size formatter = NumberFormatter.new formatter.use_fractions = true formatter.show_leading_zero = false formatter.unit = '"' size = macros.select_hardie_soffit_size text = formatter.apply(size[:thick]) + ' x ' + formatter.apply(size[:depth]) + ' x ' formatter.unit = "'" text + formatter.apply(size[:length]) and the exact number of panels. hardie_soffit_count size = macros.select_hardie_soffit_size owner.eave_fascia_length / size[:length] =macros.hardie_soffit_size could be used in the size column in the materials list, or it could be used as part of the description as shown in your example. =macros.hardie_soffit_count could be used in the count column. soffit sizes.json
  8. You might consider using the Master List to set prices.
  9. Are you using X12? The solutions mentioned so far only work in X13.
  10. I promised Carrie's Chief Academy class that I would share this macro that we showed off in class. I have since made some improvements. The attached .json file contains the macro. Much of the details about what it is doing any why is included as comments within the Ruby code. The attached .calibz file contains walls, doors, and a window. I included walls, doors, and windows derived from each of the defaults in our default template plan. These objects are already using the attached macro. You must import the macros for the library objects to work, otherwise you will get errors. To see the macro in use just open one of the library objects and look at the drywall in the components panel. If you have any thoughts on how to improve this macro please share. Below is the entire text of the macro for your convenience: # This macro is designed to estimate drywall # Chief's default estimate does not account for # drywalling over doors and windows # Chief's default estimate also rounds each wall # surface to the nearest quarter sheet. # The result of this macro can be divided by the # sheet size (in sq ft) to get an exact count # When using this macro be sure to account for # waste separately # Walls always have :upper_layers # Pony Walls also have :lower_layers # either could have drywall if owner.respond_to?(:upper_layers) and owner.respond_to?(:lower_layers) # Usually we don't want drywall in the attic so return 0.0 in this case # note: it has been brought to my attention that attic walls may provide # drywall below a sloped (vaulted, cathedral) ceiling. # For this reason you my want to delete the following line return 0.0 if owner.is_attic # sum will add up all of the things inside it # we want to add the upper drywall area to the lower drywall area [owner.upper_layers, owner.lower_layers].sum do |wall_part| # interior walls have more than one drywall layer # so lets do another sum wall_part.sum do |layer| # we only want the drywall layers so check to see if it says "Drywall" # if you call drywall something else you can check for that instead # if the material name does not contain "Drywall" this layer counts 0.0 layer.material_data.description.include?("Drywall") ? layer.area : 0.0 end end # at this point we know we are not a wall # the only thing we need from doors or windows is :height and :width # so lets make sure this owner has them # this doesn't mean it is a door or window, but we won't plan on using this # for anything else elsif owner.respond_to?(:height) and owner.respond_to?(:width) and owner.respond_to?(:is_on_exterior_wall) # for interior walls count both sides num_sides = is_on_exterior_wall ? 1 : 2 # height and width are measured in inches so divide by 144 to get sq ft num_sides * owner.height * owner.width / 144 else # this is not currently intended to compute drywall for anything else # so force an error raise "cannot compute drywall area for this object" end MatList Drywall Over openings.calibz drywall_area_macro.json
  11. Thank you for you feedback. I recommend caution in using this feature. I suspect that it does not entirely work as expected. I'm not even sure that it was originally intended for the use cases that have been described in this thread. Features that get little use get little maintenance and can become unpredictable. Virtually all of what we have heard from users that have tried this feature in recent history has been negative. Bill, you describe a compelling use case. Can you describe the work arounds that you were using? Why not just use a back clipped cross section?
  12. There is a box in the 3D View Defaults labeled "Framing Back Clip". At Chief our impression is that this feature is mostly unused. If anyone is currently using this feature can you describe what you use it for? thanks!