Ruby Question


Doug_N
 Share

Recommended Posts

In doing some ruby stuff to automate information required by building department code examiners, so I wrote a bit of simple code

 388193403_realcode.thumb.jpg.8c037037aa8535d23c209cfcea230f16.jpg

 

 

678376773_Coderef.thumb.jpg.00b1b8c394def27d040ce0d723c38213.jpg

 

to get this. 1601429432_PlanView.thumb.jpg.b1306d1a39136e90f8d9ca3d7af2504e.jpg

 

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

 

1242400075_Darnitdoesntwork.thumb.jpg.8de66e9df68e94b2170254d585a3dee3.jpg

 

Anyone know why this is?

 

real code.jpg

Link to comment
Share on other sites

Basically because in Elevation the arrow is selecting the "Exterior Room", not the "Window".

 

The only way I know of to get that in an Elevation View is by putting the macro in the Window Label and making the macro "Owner Object".  It's more complicated though because then the macro would also be displayed in the Plan View.  That means you have to have the macro display a different result in Plan View than in Elevation View and the macro has to have a way of knowing what the Current View is.

 

I can do it but it's a bit complicated.

Link to comment
Share on other sites

  • 2 weeks later...

Hey Doug, Here's a fairly simple method:

In elevation view, draw a polyline the size of the window directly over the window. Turn on "polyline labels" and use your newly created macro as the label. Depending on your settings, you may need to create a new text style for that label and of course I'd suggest giving this polyline it's own layer, or placing it on the 'window' layer.

I use this all the time to help me with my glazed opening calculations. I have macros that will display the area in metric and / or imperial.

Link to comment
Share on other sites

1 hour ago, robdyck said:

Hey Doug, Here's a fairly simple method:

In elevation view, draw a polyline the size of the window directly over the window. Turn on "polyline labels" and use your newly created macro as the label. Depending on your settings, you may need to create a new text style for that label and of course I'd suggest giving this polyline it's own layer, or placing it on the 'window' layer.

I use this all the time to help me with my glazed opening calculations. I have macros that will display the area in metric and / or imperial.

Hey Rob, 

 

thanks for the suggestion.  That is a pretty good way to tackle the problem.  Using an independent layer will allow this to be shown in some views, and not others but still see the window label.  

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

  • Member Statistics

    32606
    Total Members
    9156
    Most Online
    Jacksonpl24
    Newest Member
    Jacksonpl24
    Joined
  • Similar Content

    • By Allen43
      I have returned to this forum once again in seek some help with ruby and macros.
       
      I have been working on a macro to automate cabinet labels. So far I have a mostly working macro, but I feel like my hands are tied and my eyes are closed. First of all the documentation on chief implementation of ruby and its capabilities it really lacking. And second, I don't have the Ruby terminal. I think this is because I am running Interiors, but am not sure as all Chief says is that there is limited use of Ruby in this version.
       
      Anyways, right now I would love to have a list of all callable object attributes. I honestly don't even know if that is the right name for what I am looking for. I am trying to find a list of what info I can scrape from a cabinet. So, what can I put after obj. (ie. obj.width, obj.type)? I think I could find this by running the selected.names command in the terminal, but I have no way of knowing.
       
      This is my current macro. It is built from parts of a macro from @MarkMc and whatever I have been able to come up with from random trial and error. If you see something I could improve on, I am open to suggestions as long as they have a good explanation with them. Thanks in advance!
       
      Macro:
      obj = owner
      obj = referenced unless referenced.nil?
      obj.depth
       
      type = obj.type.to_s
       
      nf = NumberFormatter.new
      nf.unit = 'in'
      nf.use_fractions = true
      nf.show_unit = false
      nf.apply(obj.depth)
       
      standard_size = 24.0 if type == 'base_cabinet'
      standard_size = 12.0 if type == 'wall_cabinet'
      standard_size = 24.0 if type == 'full_height_cabinet'
       
      depth = nf.apply(obj.depth) if obj.depth.to_f != standard_size
       
      standard_size_height = 36 if type == 'base_cabinet'
      standard_size_height = 0.0 if type == 'full_height_cabinet'
       
      height = nf.apply(obj.height) if obj.height.to_f != standard_size_height
       
      width = nf.apply(obj.width)
       
      nomen = 'B' if type == 'base_cabinet'
      nomen = 'W' if type == 'wall_cabinet'
      nomen = 'T' if type == 'full_height_cabinet'
       
      hinging = owner.door_swing
      label = ""
      label << nomen << width.to_s << height.to_s << depth.to_s << hinging
       
      p label
       
    • By KacyRSC
      So, I am in the process of revising a set of layout Pages for a client. I have created and saved 6 different plan views, which all have individual properties to highlight different floors, layers, dimensions, etc...
       
      The problem I am having, is when I update one saved plan view, it also effects any other plan view associated with the same floor. This means my First Floor Subfloor plan view is stuck showing all the dimensions and text on my First Floor Floor plan view. I cannot change one without it effecting the other, even thought they are linked to totally different plans views.
       
      I have confirmed correct plan view links, I have tried re-linking, I have tried un-linking, I have tried deleting the associated plan views and creating new ones. Nothing I do seems to fix the issue.
       
      Please help, I need to figure this out so I can efficiently edit different plan views during the layout page creation process.
       
      Thanks in advance


    • By tlinder
      I'm trying to run a .rb file that's on my local in CA by using a marco. Right now I can only get it to read the file. Does anyone have any insight on how I might be able to to this or where I need to look?
       
      Macro: In CA
      File.read("C:/Users - Desktop/scope1.rb")
       
       
      Output: from text stored on a local drive
      rafter_length = (length.to_f.round / 12) + 1
      convert_to_int =  rafter_length.even?
      case
        when convert_to_int == true
        resut = rafter_length
        when convert_to_int == false
        result = rafter_length +1
      end
       

       
    • By Renerabbitt
      Do you have 10+ years in the software and wonder if you've been missing some tips and tricks? Have you been able to break the 15 hour condoc set?
      Maybe you are a proficient user that wants to know everything that there is to know in Chief.
      Rendering, Automation, Resources, Symbols, Quick Tools, Style Pallets, PDF Tools, Templates, and more.

      We believe in lifting the community up. All of our tools and resources are available to you. With training that can be personal, team oriented, prerecorded, livestreamed, interactive. We offer training in over 15 softwares from Drafting and Detailing to Modeling, Advanced Texturing, Procedural Workflows, Node Based Design, Macro Creations, DAMs, Automation, VR Workflows, Streaming Overlays and Masks and much much more. Tell us your needs and we will connect you with the package or the right resource.

      Some example learning modules:
      Concentric Jump your dimension strings
      Enter-input your jumps and Enter-close your DBX's
      Snap jump your door widths, concentric jump your windows
      Alt behavior tips, contain-selection and deselection workflows with tool restrictions. 
      Tons of cabinet tools and tips, including custom one-off parametrically modelled vanities and more.
      Custom Toolbar Icons and Custom Library Objects.
      Toolbar Switching Tricks and Library workflows


       
      Other Offer Services Posts:
       
    • By EmersonGraceD
      Hi there, 
       
      I was in the midst of making changes to a sheet layout when I saved out of the layout and the working plan view. I noticed there was a correction that I needed to make. When I re-opened the plan, the original plan was no longer displaying my drawings, it was also displaying on a sheet. I can't seem to find myself back on the regular active plan view. When I'm on the layout sheet, it also shows my plan funky with little to no detail and the scale is way off.
       
      The image below is of my active plan view. 

      The image below is of the layout before. 

      The image below is of the layout afterwards. 
       
       
      Thank you in advance. 
       
      Luzbella