Joe_Carrick

Members
  • Posts

    11700
  • Joined

  • Last visited

Posts posted by Joe_Carrick

  1. Here's a sample rb file that has a series of defined methods.  Note that I no longer use this since it's problematical to update with each new version of chief.

     

    #=================================================
    # Joe's Macro Subscription Service
    #   Ruby script: Float Class     
    #   Copyright October 1, 2015 by Joseph P. Carrick
    #=================================================
    # The contents of this Ruby Macro is not to be
    # revealed to any other Chief Architect user or 
    # employee.  If a violation of this requirement
    # is found, the offending subscriber's
    # subscription will be immediately terminated.
    #=================================================
    # Place this file in Chief Architect/Data/Scripts
    # folder.  Then place the following:
    #    require "Float Class.rb"
    # at the beginning of any macro where you want to
    # use these methods
    #=================================================
     
    class Float
        #=================================================================
        # Display a numerical value formatted according the the current
        # units of the Plan.  Requires $Units to be either "Imperial" or
        # "Metric" to recognize the units.
        #=================================================================
        def format_number(n)
            if $Units.nil?
                result = self.sig(3)
            elsif $Units == "Imperial"
                result = self.ftin(32)
            elsif $Units == "Metric"
                result = self.meters(n)
            else
                nvalue = self.sig(3)
            end
            return result
        end

        #=================================================================
        # Display a value (decimal inches) formatted as a text string
        #    syntax:  nvalue.ftin(denominator)
        #    example: n = 64.125
        #             s = n.ftin(8)  ->  5'-4 1/8"
        #=================================================================
        def ftin(denominator)
            if $Units.nil?
                nvalue = self
            elsif $Units == "Imperial"
                nvalue = self
            elsif $Units == "Metric"
                nvalue = self/2.54
            else
                nvalue = self
            end
            arr = self.divmod(12)
        if arr[1] >= 11.96875
          arr[0] = arr[0]+1
          arr[1] = 0.00
        end
        
            inch_frac = ((arr[1]-arr[1].floor)*denominator).round.quo(denominator)
        
            if arr[0].floor < 1
                if inch_frac == 1.0
                    result = "#{arr[1].ceil}"+'"'
                elsif inch_frac == 0.0
                    result = "#{arr[1].floor}"+'"'
                elsif inch_frac < 1 and arr[1].floor > 0
                    result = "#{arr[1].floor} #{inch_frac}"+'"'
                elsif inch_frac < 1
                    result = "#{inch_frac}"+'"'
                else
                    result = "#{arr[1].floor} #{inch_frac}"+'"'
                end
            else
                if inch_frac == 1.0
                    result = "#{arr[0]}'-#{arr[1].ceil}"+'"'
                elsif inch_frac == 0.0
                    result = "#{arr[0]}'-#{arr[1].floor}"+'"'
                else
                    result = "#{arr[0].floor}'-#{arr[1].floor} #{inch_frac}"+'"'
                end
            end
            return result
        end

        #=======================================
      # Convert Float to Feet
      #  rounded to nearest foot
      #=======================================
      def feet
          feet = (self/12).round(0).to_s
            result = feet +"'-0"
          return result+'"'
      end    

        #=======================================
      # Convert Float to Decimal Feet
      #  rounded to 3 decimal places
      #=======================================
      def decimal_feet
          feet = (self/12).round(3).to_s + "'"
          return feet
      end    

        #=======================================
      # Convert Float to Inches-Fractions
      #  Formats are:
      #    1/16"
      #    1 1/16"
      #    1"
      # nDivisor can be any integer between
      #    1 and 32.  Most common are:
      #               1,2,4,8,16 & 32
      #=======================================
      def inches(nDivisor)
          inches = self.floor
        if inches > 0.00
          frac = (self.remainder(inches)*nDivisor).round.quo(nDivisor)
        else
          frac = (self * nDivisor).round.quo(nDivisor)
        end
          if frac == 1
              result = "#{inches + 1}"
          elsif frac == 0 
              result = "#{inches}"
          else
              result = "#{inches} #{frac}"
          end
          return result.gsub(" ","-")+'"'
      end    

        #=================================================================
        # Get the SqRt of a number to n significant places
        #=================================================================
        def sqrt(n)
          a = self
            x = 1.00000
            while (x*x) < a
              x = x+0.00001
            end
            return x.round(n)
        end
        
      #=================================================================
        # Display a decimal value as a text string to (n) significant places
        #    syntax:  nvalue.sig(n)
        #    example: x = 65.375
        #             s = x.sig(4) ->  '65.3750'
        #    example: x = 65.25
        #             s = x.sig(3) ->  '65.250'
        #=================================================================
        def sig(n)
            nPad = self.round().to_s.length + n + 1
            result = self.round(n).to_s.ljust(nPad,"0")
            return result
        end

        #=================================================================
        # Convert millimeters to meters & display to (n) significant places
        #    syntax:  nvalue.meters(n)
        #    example: x = 6543
        #             s = x.meters(3) ->  '65.430 m'
        #    example: x = 650
        #             s = x.meters(3) ->  '6.500 m'
        #=================================================================
        def meters(n)
            if $Units.nil?
                nvalue = self
            elsif $Units == "Imperial"
                nvalue = self*2.54
            elsif $Units == "Metric"
                nvalue = self
            else
                nvalue = self
            end
            if n > 3
                n = 3
            elsif n < 0
                n = 0
            end
            m = nvalue/100
            result = m.sig(n).to_s + " m"
            return result
        end

    end


     

    • Upvote 1
  2. 9 minutes ago, tlinder said:

    Thanks Joe

    The macro works in evaluated, just trying to take it one step further and save the company a lot of time.

    I'm am trying to read it from my local so I don't have to open every CA file and update them 1 by 1. We have hundreds of files.

    You don't read the rb file.  You "require" it.  Within that file you need to define the function"int_length"and then in your macro you call the function.

    ie:  

    • result = int_length(length)

     

  3. You should just make this an evaluated macro in chief, context: owner

     

     

    rafter_length = (length.to_f.round / 12) + 1

    convert_to_int =  rafter_length.even?

    case
      when convert_to_int == true
      result = rafter_length

      when convert_to_int == false
      result = rafter_length +1
    end

     

    Using an rb in this case is superfluous.  IAE, to use one you would need to "require" it in your chief macro and then call any specific "defined" function within that rb file.  The only reason for using an rb file is for utility functions that aren't otherwise available that you would need in many different user macros.  This one is object specific to any object that has a "length" attribute.

  4. 49 minutes ago, DGail1 said:

    Sorry Joe, those can't be changed

    That's what you get with stock cabinets.  I use a company that is much more flexible in their sizes.  ;)

    OTOH, I never have to specify the door or drawer sizes.  The Cabinet Manufacturer does it automatically even when I specify odd sizes down to 1/16" increments.

  5. Chief doesn't seem to have a way of placing window screens on windows.  I know that renderings probably look better without screens but they really should be present even if repressed for rendering.

     

    How do you handle the specification of window screens ?

     

    Should Chief provide a way to specify them other than just a "comment" ?

  6. I just noticed that I can specify different Drawing Sheet sizes for each view in a Plan.

    Is this a new capability with X14?

    I don't recall being able to do that previously.

     

    It's really nice for positioning of Details, etc in Layout.

     

    Maybe what I'm thinking of is just that we couldn't have different page sizes within a Layout.

  7. 11 minutes ago, Pino_Tenerelli said:

    Hello fellow CA users!!

     

    Does anyone know if it is possible to customize the actual buttons on your toolbar? I use specific types of cabinets and would love to have shortcut buttons for each of these that I use frequently...

     

    If there isn't, then hopefully the ChiefArchitect programmers are reading this??

    If you are using the "Place Library Object" for your Toolbar Buttons then you can assign any ICON you want.

    • Upvote 1
  8. I like all my Floor Plan Views ( Architectural, Foundation, Framing, Elecrical, Mechanical, Plumbing, etc ) at exactly the same location in the Layout.

    In order to make this easy:

    • I display the drawing sheet in all such views - but not in Elevation and Section Views.  
    • I specify margins matching the Layout ( left, top, right, bottom )
    • I position the drawing sheet so that my model fits within the margins.

    Then when I send a plan view to layout I specify "Entire Plan/View"

     

    The above ensures that all my Plan Views are at the same exact position on each page of the Layout.  It also allows me to see that the Plan will fit on the current drawing sheet size.  If it doesn't I just change the drawing sheet and Layout Page sizes (my Layout Templates)

    • Upvote 3
  9. 1 minute ago, robdyck said:

    This function is new to me! Probably because I never use a WMR for an entire wall. Handy tip to know though!

    It's kind of simple.  to get the WMR for the entire wall you just click anyplace on the wall.

  10. So, by way of explanation, I'm doing a project with SIPs.  I have 2 thicknesses of the SIPs (4" & 6") and the following wall surfaces:

    • 5/8" Drywall both sides
    • 5/8" Drywall Interior 1" Stucco Exterior
    • 5/8" Drywall one side - other side exposed framing
    • 1" Stucco both sides
    • Stone Veneer Exterior 5/8" Drywall Interior
    • Stone Veneer Exterior - other side exposed framing

    So that can add up to a total of 12 Wall Types - just for this project alone.

     

    OTOH, it's only 2 basic Structural Walls & 3 sets of Finish Layers which could be WMR's. 

     

    Based on the possibility of Stud Wall, CMUs, Concrete, etc plus a couple of other finishes it's easily possible to wind up with another 40-50 distinct Wall Assemblies.  In order to avoid having to define several wall types for each new project I save them in  my Library.

     

    This is why I would consider changing my methodology - but only if I could still have the full wall definition in the Wall Schedule.

     

     

    • Like 1
  11. 1 hour ago, rgardner said:

    Just curious…

     

    Why?

     

    It would simplify the Wall Types by having only about 8-10 Wall Types (Just the Structural Layers)

    All Finish Layers would be WMR's.   

     

    Currently I have about 100 Wall Types in my Library - various structural mixed with all sorts of finishes.

     

    IOW, I wouldn't need different Wall Types for every possible set of Finish Layers - Interior & Exterior.

  12. With the new Mitered Material Regions I thought i'd try something with "Structural Wall Types".

     

    Specifically I wanted to limit my Wall Types to just the structural elements. ie:

    • SIP's
    • CMU's
    • Concrete
    • etc.

    and then add Wall Material Regions to the Interior and Exterior.  This works - but only to a point.  The problems I've come up against are:

    • Doors and Windows don't recognize the thicknesses of the WMR's as a part of the wall, so casings, etc are not automatically where desired.
    • When a WMR covers the entire wall surface I can't select the wall in 3D.
    • WMR Fills don't show in Plan Views
    • Wall Schedules don't include the WMR's

    If these things could be overcome I would probably change my approach to Wall Types entirely.

    • Upvote 3
  13. I often have rooms with lowered ceilings (below the standard floor ceiling height) and have developed a pretty simple way to do this without creating a separate ceiling plane.

    Here's the basics:

    • edit the room's ceiling finish by adding 2x4 ceiling joists and an air gap
    • the air gap should be the amount the ceiling is to be lowered minus 3.5"

    Typically I want to lower ceilings 0", 6", 12", 18" & 24"

    To make this really easy I create a series of named "Style Palettes"  consisting of rooms with the above ceiling finish definitions.  The "Style Palettes" only have the following properties checked:

    • Ceiling Finish
    • Ceiling Structure
    • Has Ceiling

    I put those 5 Style Pallets in my User Library Folder "Furred Ceilings".

    Now, when I want to change a room's ceiling height  I just select the desired Style Palette and "paint the room" with that style.

     

    This is a big time saver. B)

     

    If you want more options you can just copy-paste one of the Style Palettes, rename and then edit the room's ceiling finish.  That's a very easy way to add additional options.

    • Like 3
    • Upvote 4
  14. 1 hour ago, BrianBeck said:

    Joe, I have not been able to reproduce this in my simple test cases. Please make sure to send an example of the issue you are having into tech support.

    Hi Brian,

    It appears the problem was with a plan that I had not yet saved in this version.  It's working now.

    It would be nice if we could just pull around a corner similar to how we can draw walls and lines.

    • Upvote 1