Results 1 to 3 of 3

Thread: Wall Tags - Leading Zeroes in a length/number/integer/currency

  1. #1
    Member
    Join Date
    2011-01
    Posts
    6
    Login to Give a bone
    0

    Default Wall Tags - Leading Zeroes in a length/number/integer/currency

    This really shouldn't be this difficult, but I suspect it's impossible...

    Basically, we've decided to use curtain walls for our glazing moving forward. Whislt I'm opposed to this and would prefer to use windows, there is a sense of logic to it (flexibility and simplicity especially). So I'm trying to create a wall tag that will report the "window" size in an Aus standard: HHWW Fx (i.e. Height x Width rounded to nearest decimeter; primary function. So a 1200mm x 2400mm Fixed window reads as 1224 Fi).

    So long as the window size is greater than 1000mm in both directions this is simple enough with two calculated parameters (Unconnected Height / 100mm and Length / 100mm) and an instance parameter for function. But, if the window is less than 1m I need it it to still be two digits (e.g. 09 for 900mm). There is no way on Revit's Green Earth to do this natively inside the tag family. Every single combination I've tried either drops the leading zero, or throws up inconsistent units errors (for conditional statements > converting to a string). With no way of extracting/pushing data between family type paramters and the label paramters in a tag, I'm extremely limited wrt janky work-arounds.

    The one work-around I had was manual: create (four) different types within the family using conditions + visibility to switch on/off tags with a hard 0 prefix. But that is far too manual (and cumbersome) and prone to error, especially on larger projects. I've looked at Dynamo, specifically this @ the architect's blog, but I have no idea how to even get started tying that into a wall tag family.

    Help me Obe Wan Kenobi, you're my only hope...

    p.s. some justification: curtain walls instead of windows. Whilst I'm a bit of a purist and prefer to use proper elements in a model, complex windows that can offer complex changes to panel types and/or number of panels/mullions on the fly - or jointless corner windows, which we use a lot - became far too complex to use and create...

  2. #2
    Super Moderator dkoch's Avatar
    Join Date
    2003-03
    Location
    Philadelphia, PA
    Posts
    2,392
    Login to Give a bone
    0

    Default Re: Wall Tags - Leading Zeroes in a length/number/integer/currency

    I have started to look at this, but I am not certain how much time I will have to do so over the next few days. So a proper reply may be a while.

    From my initial examination, it looks like the Curtain Wall Unconnected Height parameter will give the height you need and the Length parameter will give the width. Add two shared parameters, as instance parameters that apply to Walls. One text parameter into which you would enter the "Fx" (primary function) value. The other a text parameter to receive the concatenated string that your label will display. A Dynamo graph would then read in the Unconnected Height and Length values, divide by 100, apply zero padding, concatenate the two values with the function string and push the value to the second shared parameter. Create a Wall tag that displays that second shared parameter.

    I have figured out how to get a list of just the Curtain Walls in a project file. (It is not as straightforward as you might expect it would be.) I just need some more time to work out the balance of the Dynamo graph and to test it out.

  3. #3
    Super Moderator dkoch's Avatar
    Join Date
    2003-03
    Location
    Philadelphia, PA
    Posts
    2,392
    Login to Give a bone
    0

    Default Re: Wall Tags - Leading Zeroes in a length/number/integer/currency

    First thing to point out is this follow up post to the blog article you cited, which notes that after I worked out two different Dynamo graphs for doing zero padding of integers, I discovered the Pad Left and the Pad Right nodes in Dynamo, which do the same thing, and then some (any character can be used as the padding figure, any string can be used as input, and Pad Right will add characters to the end of the string).

    I was able to work out a Dynamo graph that may support what you are trying to do. As previously noted, the following assumptions went into what I did:
    • The Window width is the Length parameter of the Curtain Wall.
    • The Window Height is the Unconnected Height parameter of the Curtain Wall.
    • A shared parameter is created to hold the primary function string. If you do not need to use this independently in a tag, you may be able to just make this a project parameter, without making it a shared parameter. I chose to make it a shared parameter, called Primary Function.
    • A shared parameter is created to hold the concatenated string to be displayed in the tag. I called this parameter Curtain Wall Tag String.


    The attached ZIP file contains the Dynamo graph created in the 1.3.2 version (Curtain Wall Tag Data 1-3-2.dyn), a test project file (Test001.rvt), a test Wall tag family file (CurtainWallTag.rfa) and a shared parameter file (Shared Parameters - Curtain Wall Tag Test.txt). The Revit files were done in the 2018 release. Given the tedium of integrating shared parameters from separate files (unless you have a utility add-on that will do that for you), you may want to create your own shared parameters, in your firm's shared parameter file, placed in a Group that works with your other Groups and Parameters. If you choose to use different names, you only need to modify the String nodes where those parameters names are entered:
    • Primary Function can be found in the Primary Function node group, light gray background, at the bottom of the four node groups with light gray backgrounds.
    • Curtain Wall Tag String can be found in the Push Value to Tag Parameter node group, purple background, and the far right end of the graph.


    The Select all Walls node group, light green background, selects all of the Walls in the project file. There is no separate category for Curtain Walls; those have to be pulled out of the list of all Walls. The Select only Curtain Walls node group takes the list of all Walls and passes along only the Curtain Walls.

    The four node groups with light gray background create the pieces of the string that is to be displayed in the tag.

    The Process Unconnected Height (HH) and Process Length (WW) node groups, light gray background, two topmost of the four node groups with light gray backgrounds, contain the nodes that get the Unconnected Height or Length parameter value (assumed to be in millimeters) and divides the value by 100 (decimeter). The value is then rounded. The native rounding in Dynamo rounds exactly 0.5 "to even". That means that both 1.5 and 2.5 round to 2. I assumed that you wanted 0.5 to always round up (1.5 to 2; 2.5 to 3). If that is not the case, and rounding to even is acceptable, then both of these sections can be greatly simplified. Once the rounding is done, the result is converted to a string, and if the result is a single-digit string, the string is padded with an initial "0". So "9" becomes "09".

    The Spaces node group creates a list of strings, each of which is a single space (" "), to separate the HHWW from the Fi in your tag specification.

    The Primary Function node group creates a list of the values held in the Primary Function parameter.

    The Create Tag Values node group (dark gray background) takes the lists of the four components and concatenates them into a single list of strings in the HHWW Fi format, each one associated with a particular Curtain Wall.

    Finally, the Push Value to Tag Parameter node group (purple background) takes the concatenated strings and pushes the value onto the Curtain Wall Tag String parameter.

    The graph is saved with Manual run mode, so it will not automatically run when you open it in Dyanmo. You will need to select the Run button to have it run. There are a few Watch nodes that are not inside any of the node groups that I used while I was testing the graph. I chose to leave them in, should it be necessary to diagnose an "issue".

    Both shared parameters were loaded into the sample project file as Project Parameters. The Curtain Wall Tag String parameter was loaded into the Wall Tag family when creating the Label, in order to be able to specify that parameter in the Label. The Dynamo graph was run in the sample project to get the Curtain Wall Tag String parameter values populated. The Curtain Walls were then tagged in both plan and elevation.

    Curtain Wall Tag Data 1-3-2.png
    Attached Files Attached Files
    Last edited by dkoch; 2017-12-28 at 03:50 AM.

Similar Threads

  1. Number of intermediate items dependant on length
    By beardking in forum Dynamic Blocks - Technical
    Replies: 2
    Last Post: 2011-05-19, 04:26 PM
  2. Select case by integer - Restrict integer value to one
    By CADfunk MC in forum VBA/COM Interop
    Replies: 4
    Last Post: 2010-05-24, 08:02 AM
  3. Replies: 6
    Last Post: 2009-01-19, 11:59 AM
  4. Help?! Fully Parametric Cupboard base on input length and number of CBD required?
    By Richard McCarthy in forum Revit Architecture - General
    Replies: 9
    Last Post: 2008-09-12, 04:37 PM
  5. Replies: 8
    Last Post: 2006-10-12, 12:58 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •