March 28, 2015

ACA/AMEP 2016: Styles Browser Part 2

The Styles Browser Interface (Continued)
Part 1 focused on the top part of the Styles Browser; this article will examine the style/defintion list box and related controls.

The Styles Browser has a tool bar at the top of the style/defintion list box. Three tools at the right side of this bar control how the styles/definitions are viewed: Preview Size, View Direction and Color Selection. As seen in the image below, the Preview Size tool has a drop-down list which offers four viewing choices: Small, Medium and Large preview images and Details, which shows just names and descriptions in text. Note that selecting the Details option will disable the View Direction and Color Selection tools, as these settings do not apply to the Details view. The icon of the currently selected tool is displayed on the tool button.

The View Direction tool has a drop-down list which offers the six standard othogonal and four standard isometric view directions. The initial default view direction varies with the Object Type selected. As with the Preview Size tool, the icon of the currently selected view direction is displayed on the tool button.

The Color Selection tool has a drop-down that allows you to select the background color of the preview images. The None option uses the palette background color. You can choose from a range of color swatches, including AutoCAD® index colors 1-9, or choose the More Colors option at the bottom to open the standard color selection dialog, offering the full range of Index colors, True Color and Color Books. A Recent Colors section is offered if you choose a color not offered on the pull-down. Setting a background color other than None (such as matching your AutoCAD background color) may be useful if you find it hard to see the preview graphics images with the Styles Browser background color.

When AEC Dimension, Display Theme or Zone are chosen as the Object Type, the tools at the right end of the tool bar will all be disabled, as the only view option for these is Details.

Hovering over a style or definition in the list box will display a Tool Tip, whether or not Tool Tips are enabled in the Options dialog, on the Display tab. Most styles/definitions have a two-stage tool tip; the first stage is all text, listing the style/definition name, description and the source file (or Current Drawing for styles/definitions in the current drawing). If you hover longer, the Tool Tip will expand to include image previews showing that style/definition in isometric, left, front and plan views. There is no expanded Tool Tip with graphics for the AEC Dimension, Display Theme and Zone Object Types.

The tools at the left side of the tool bar control the use of the styles/definitions displayed in the Styles Browser: Import styles, Add object and Apply style to selection. Selecting one of the styles or definition in the list box enables the relevant tools. The Import styles tool will be inactive if a style/definition from the current drawing is selected. The Apply style to selection tool will be inactive if no objects of the selected Object Type are selected in the current drawing. The same three options are available in a context menu when you right click on a style or definition. You can also double click on a style/definition to initiate the ADD command for that object type, using the selected style/definition (imported into the current drawing, if necessary).
When all of the objects that are selected in the current drawing are of the current Object Type and are all of the same style/definition, then that style/definition will be outlined in blue. When a style is selected, the entire style is highlighted in blue. If the cursor moves off of the palette, the blue color is removed, but the selected tool remains highlighted. If you wish to clear the current style/definition selection, press the ESC key.

If the current drawing already has a style/definition of the same name as one in a source file, a green checkmark will appear next to the style(s)/definition(s) in the source file(s). You will not be able to import these styles, and if you choose the Add or Apply options for these styles, the style/definition in the current drawing will be used. You cannot use the Styles Browser to update a style in the current drawing with one of the same name in a source file. Use the Style Manager to do this, when necessary.

All of the usual options for displaying a palette apply to the Styles Browser: Transparency, Auto-hide, Docking and Anchorage. Right click on the palette title spine and use the context menu to choose your display options.

The Styles Browser provides easy access to styles and definitions from office standard source files, project standards files and currently open drawings, without the need to create or maintain an extensive set of tool palettes and tools. When you upgrade to AutoCAD® Architecture 2016, try it out and see if it can improve your workflow.

March 25, 2015

ACA/AMEP 2016: Styles Browser Part 1

A new modeless (can be open while executing other commands) palette has been added to the 2016 releases of AutoCAD® Architecture and AutoCAD® MEP, the Styles Browser. You can use the Styles Browser to quickly review the AEC object styles available in your choice of Content Library Drawings, Project Standard Drawings or Currently Open Drawings. Once you find the desired style, you can import it into the current drawing, add an object using the selected style or assign the selected style to an object of that type already in the drawing. Using the Styles Manager, you can avoid the need to create and maintain a Tool palette tool for every office standard style while still providing easy access to those styles. You can easily add additional source files, when needed for a specific project, to provide access to project-specific content without creating project-specific Tool palettes.

Opening the Styles Browser
As with most everything AutoCAD-related, there are a number of ways to access the Styles Browser.
  • From the ribbon: On the Home ribbon tab, on the Build panel, select the bottom half of the Tools split button, and then choose Styles Browser from the context menu.
  • From the Command line: Type STYLESBROWSER and press the ENTER key.
  • From the Properties pallete with a style-based AEC object selected: On the Design tab, under the Basic category, under the General subcategory, with the Style Preview active, select anywhere in the Style Preview area.
  • From the Properties pallete with a style-based AEC object selected: On the Design tab, under the Basic category, under the General subcategory, with the Style Preview inactive, on the Style property, select the Select a style button (binoculars icon) at the far right side.
As noted for the last two methods using the Properties palette, you must have a style- or definition-based AEC object of a type that is supported by the Styles Browser (see below). When using these methods, the Styles Browser will open with the Object Type pre-set to the type of object selected, with that object's style selected.

The Styles Browser Interface
The top portion of the palette contains three pull-down lists, a Search Style edit box and a button to open the online help to the Styles Browser topic. The selections made in the pull-downs and the search string entered into the edit box, if any, will determine the styles/definitions that you will be offered in the style list box below. While you can visit the pull-downs in any order, it makes the most sense to start from the top and work your way down, in order, as the choices available in the third list will be affected by what is set in the first two.

The Object Type pull-down contains a list of all of the object types that are supported in the Styles Browser, divided into separate sections for Architectural Objects, Documentation Objects and Multi-Purpose Objects. Use the +/- button at the left side of the section headers to expand or contract each section. Select the object type on which you wish to operate. The image below is a composite to show the entire list.

The Drawing Source pull-down offers up to three options for determining the possible drawing sources for styles: Content Library Drawings, Project Standard Drawings or Currently Open Drawings. Content Library files are user-selected files that contain "office standard" styles. These can include the same files you use as source files for your Tool palette tools, and the initial list includes the out-of-the-box style source files. (See below for more on this.) Project Standard Drawings will only be included on the list if you have an ACA Project (Project Browser/Project Navigator) open. As you might expect, Currently Open Drawings will make the styles/definitions in all currently open drawings available.

The third pull-down, Drawing File, allows you to further refine the source files used for the styles/definitions that are displayed. The choices here will vary with the Object Type and Drawing Source selected in the first two pull-down lists. The list starts with All Drawings, which will include all of the drawings included in the selected Drawing Source, plus the current drawing. Current Drawing will only show items from the current drawing. All Without Current Drawing will show styles/definitions only from the file(s) from the specified Drawing Source, but will not include those in the current drawing. These three choices will then be followed by the individual file(s) from the specified Drawing Source, allowing you to limit the items shown to just that one drawing.
When using Currently Open Drawings as your Drawing Source and only one drawing file open, selecting All Without Current Drawing in the Drawing File drop-down list will result in an empty style/definition list box, since there are no other drawings open. You can only select one item from the Drawing File dropdown list, so you will not, for example, be able to hold down the CTRL key and choose two individual drawings. Similarly, if Project Standard Drawings is selected as the Drawing Source when Project Standards is disabled for the current Project, choosing All Without Current Drawing in the Drawing File drop-down list will also result in an empty style/definition list box.

The final means of affecting the styles/definitions that are shown in the style list box is the Search Style edit box. Any text entered here is compared to the names of the styles/definitions that meet the criteria of the choices made in the three pull-down lists, and only those that match the string are shown. Any portion of the name may be entered; for example, in the image below, only the Wall Styles that have the text Air-2 somewhere in the style name are shown. The entered text is treated as a wild-card string, with an * before and after the text. You cannot, however, type wildcard characters as part of the search string; all typed characters are interpreted literally.

As previously mentioned, you can customize the drawings included when Content Library Drawings is the selected Drawing Source. To do so, select Content Library Drawings as the Drawing Source, and then select the Drawing File pull-down list. At the bottom of the list, select the Manage Content Library button. This will open the Content Drawings Library dialog, in which you can add or remove drawing files from the list of source files for the Object Type selected in the top drop-down list. Make note of the Save as default toggle in the lower left corner. With this toggle unchecked, you can make "temporary" changes to the list of content drawings by adding and/or removing files and selecting OK. For example, if your current project does not have any Walls with brick components, you could remove the brick Wall source file from the list temporarily. Any "temporary" changes will persist, even after closing and reopening the program. You can, however, restore the saved list by reopening the Content Drawings Library dialog and using the Restore button. If you want to change that saved list, make the desired changes, check the Save as default toggle and then select OK.

Once you have made your selections in the drop-down lists, you may wish to save some of that vertical space in the palette. You can do so by selecting the button with the upward pointing arrowhead icon, bewteen the Search Style edit box and the style/defintion list box. This will leave only the Object Type pull-down list and expand the area available to list box. In the collapsed state, you can make changes to the Object Type selection. If you do so, the Drawing Source and Drawing File choices will remain the same, but any text in the Search Style edit box will be cleared. Select the button again (now with a downward pointing arrowhead), to expand the filter controls if you want to make changes or add text to the Search Style edit box.

The final feature in the top portion of the palette is the Help button (speech bubble icon with ?), which provides direct access to the online help topic on the Styles Browser.

In Part 2, the features associated with the style/definition list box, and the ways of using the Style Browser will be covered.

March 21, 2015

ACA 2016: Quick Notes

Here are some quick thoughts on the upcoming 2016 release of AutoCAD Architecture, while you wait for more in-depth articles on new features.

No change in file format!

Same interface color scheme choices as 2015 (truly dark Dark and Light).

The Drawing Window Status bar has now been completely removed from ACA and AMEP, and the tools that had been there in 2015 - Display Configuration control, Cut Plane control and System Tray - have been moved to the Application Status Bar, which is now referred to as the Status Bar. The "Cut Plane" text in the Cut Plane control has been replaced with an icon, and the control will only be displayed when Model Space is active. The STATUSBAR system variable now only supports values of 0 (Status Bar off) and 1 (Status Bar on). The Status Bar will now also wrap onto a second row if more tools are turned on that will fit on a single row.


The "New Tab" has been renamed to "Start". The content on both the Create and Learn pages of the Start tab is similar to the 2015 New Tab. (In 2016, I have a Notifications area that is not present in 2015 - I am not certain if that is new, or that I just do not have any current notifications in 2015.)

The Start tab remains available even after you start a new drawing or open and existing one, unlike the New Tab in 2015. It does not have a close button ("X") at the right end of the tab, like drawing tabs (and the 2015 New Tab) do. For those who would prefer to do without the Start tab, the former NEWTABMODE system variable from 2015 has been renamed to STARTMODE. Set it to 0 to close the Start tab and disable it on future launches. Set it to 1 to re-enable the Start tab. Note that when changing the value from 0 to 1, you will have to close and restart the program to get a Start tab; one will not immediately appear in the interface after changing the value to 1. There is no equivalent of the old NEWTABMODE setting of 2, which allowed the "+" button to the right of the tabs to open a new file based on the default template, rather than creating another New Tab (NEWTABMODE = 1 behavior). Since the Start tab is now either always on or always off, the "+" button always opens a new file based on the default template (or opens a dialog asking you to select a template file if no default template is specified). When creating a deployment, you have the option to enable or disable the display of the Start tab.

New CLOSEALLOTHER command allows you to close all but the current drawing tab from the command line. As in 2015, you can also right click on any drawing tab and choose the Close All Other Drawings to close all drawing tabs other than the one on which you right clicked (which does not have to be the current drawing tab).

Coordination models created in Navisworks (NWD or NWC files) can now be attached to a drawing using the means use to attach other reference files (DWGs, DGNs, PDFs, image files, etc.), as well as the new CMATTACH command (-CMATTACH for the command line version). If the current drawing file is included in the coordination model, you have the option to turn off the current drawing's geometry in the coordination model. You can also apply color fading and opacity fading to the coordination model, to improve your ability to distinguish between the coordination model and the current drawing geometry. This feature requires a 64-bit system, with hardware acceleration turned on.

March 15, 2015

ACA: Column Labels

Those who have used the AecColumnGridLabel command (COLUMNGRIDLABEL also works; on the Column Grid contextual ribbon tab, on the Label panel, the Label tool) to add grid bubbles to a "standard" Column Grid object will recall that there are radio buttons on both the X-Labeling and Y-Labeling tabs to choose either an Ascending or Descending order for the labels.

For Custom Column Grids created by converting linework, the AecCustomColumnGridLabelAdd and AecCustomColumnGridLabelEdit commands (CUSTOMCOLUMNGRIDLABELADD and CUSTOMCOLUMNGRIDLABELEDIT; on the Column Grid contextual ribbon tab, on the Label panel, the Add Labels and Edit Labels tools) allow you to select one or more of the custom grids and add/edit grid bubbles. When more than one grid is selected, an increasing sequence of label values is generated, based on the order the grid were selected, so you can control the ordering when selecting the grid lines.

Control over the ordering of grid labels when creating or editing Enhanced Custom Column Grids is also possible. You could place the grid and then use the same commands/tools noted above for Custom Column Grids, but that would not allow you to take advantage of the automatic secondary label formatting available with the enhanced custom grid. The good news is that you can control the ordering of the labels either when initially creating an Enhanced Custom Column Grid (AecCustomColumnGrid or CUSTOMCOLUMNGRID; on the Home ribbon tab, on the Build panel, the Enhanced Custom Grid tool) or editing one (AecCustomColumnGridEdit or CUSTOMCOLUMNGRIDEDIT; on the Column Grid contextual ribbon tab, on the Custom Grid panel, the Edit Grid tool). Either of these actions opens the Column Grid dialog.

The bad news is the location of where you would indicate whether you want an ascending (the initial default) or descending order is not immediately obvious, as it is in the Column Grid Labeling Dialog for standard Column Grids. What you need to do is select the X-Labeling and/or Y-Labeling drop-down lists in the Bubble Parameters area, Label Format sub-area, and choose the Custom: ZZZ option, where ZZZ is a varying string indicating the currently selected labeling options. As shown in the image below, the Custom Label dialog that appears after making that selection allows you to choose the ordering (Left to Right or Right to Left for the X-Labeling and Bottom to Top or Top to bottom for the Y-labeling).
Any changes made in the Custom Label dialog will be reflected in the Preview pane of the Column Grid dialog, and, after pressing OK to dismiss the Column Grid dialog, in the actual labels in the drawing.

February 09, 2015

ACA: PICKFIRST Reminder

This issue came up at the office the other week, and I figured that I could use a reminder on the "power" of the PICKFIRST System Variable in AutoCAD® Architecture and MEP.

Setting PICKFIRST to 1 (or, in the Options dialog, on the Selection tab, in the Selection modes area, checking the Noun/verb selection toggle) enables you to pick objects [nouns] first, and then indicate the action or command [verbs] you want to apply to them. Enabling PICKFIRST also allows the following:
  • Double-clicking objects and having the double-click action take effect, such as double-clicking on Mtext or Text and entering the associated text editor.
  • Selecting objects and pressing the DELETE key to erase.
  • Selecting AEC objects, right-clicking and getting AEC Commands related to the selected object in the context menu. In the image below, with time-sensitive right click turned off, you can see the differences in the context menus pressented with PICKFIRST set to 1 and 0.

February 02, 2015

Revit: Residential Door Tag 2 - Reporting Parameter Example

There was a follow up question in the Autodesk AutoCAD Architecture General Discussion Group regarding the use of an imperial "Residential" format Door Tag, which I had previously written about in this blog article. The question concerned using an imperial residential-style tag on a door in a Curtain Wall, as the Width and Height parameters that the technique I outlined for a "regular" door are not present in the Curtain Wall Door family.

It is still possible to follow the technique from the previous post in a Curtain Wall Door, with a few minor tweaks. I am going to assume that you have already set up the Shared Paramters used by the residential door tag for your "regular" doors (per the previous blog article), you want to use the same tag for both regular and curtain wall Doors and that you have access to the Shared Parameter file used on your regular Door families and the Door Tag.

  1. Edit your Curtain Wall Door Family.
  2. Using the Project Browser, open the Views > Floor Plans > Base Line view. There should be reference planes defining the width of the door.
  3. If there is no dimension between these two reference planes, add one. (In the out-of-the-box Curtain Wall Sgl Glass.rfa family, there was not an overall dimension between these, your family may have one.)
  4. Select the dimension between the width-defining reference planes, and on the Options bar, choose the label drop-down and select the Add Parameter option.
  5. In the Parameter Properties dialog, give the new parameter a name. I chose to call this DoorWidthReporting, you may prefer a shorter name.
  6. For the new parameter choose a group (I accepted the default Dimensions group), choose the Instance radio button and check the Reporting Parameter toggle. This will make the parameter available for scheduling and formulas. Add a tooltip, if desired, and then select OK to add the new parameter.
  7. In the Project Browser, open the Views > Elevations > Interior view (Exterior will also work). There should be a Base Line level and a reference plane defining the height of the door.
  8. If there is no dimension between the level and the top reference plane, add one. (In the out-of-the-box Curtain Wall Sgl Glass.rfa family, there was an overall dimension between these.)
  9. Select the dimension between the level and the top reference plane, and follow the procedure used for the DoorWidthReporting parameter above to create a reporting parameter for the height dimension. I called mine DoorHeightReporting.
  10. The family now has two instance parameters that will have the height and width of the Curtain Wall Door when placed in a Curtain Wall in a project. Now the parameters from the previous blog article can be added to generate the parameters for the residential-style tag. For Curtain Wall Doors, make all of these parameters instance-based, so that they will be able to reference the instance-based reporting parameters for width and height. Use the same Shared Parameters from the same Shared Parameter file as you use for your other Doors if you intend to use the same tag.
The image below shows an instance of a Curtain Wall Door in a project; in the Properties palette, you can see the reporting parameter values under the Dimensions category as well as the parameters under the Data category that are used to generate the parts of the residential Door Tag. Keep in mind the way the Data parameters are set up, the tag will only show feet and whole inch values; any fractional inches will be dropped. Since Curtain Wall Doors will "expand" to fit the opening in which they are placed, you will have to set up the Curtain Grid and Mullions around the Door to result in an even-inch width and height (which you would probably do, anyway). If you need fractional inches, then you would either need to abandon the "residential" approach or add parameters to capture the fractional inch amounts and devise a way to show them in the tag that will be readable.

January 17, 2015

Revit: Ceiling Pattern Will Not Move

A hearty thanks goes out to Steve Stafford, who documented the solution to a problem that arose in my office yesterday, way back in 2012, in his Revit OpEd blog.

The problem is that if you use the Move tool with the Disjoin option checked, and then later in that session try to use it to move a Ceiling grid pattern or other model pattern, Revit "remembers" that the Disjoin option was selected previously, and starts out with it turned on. Since Disjoin is not applicable to moving a model pattern, Revit disables (grays out) this option when a model pattern is the object of the Move tool. You might think that since the option is disabled, that it would not have any effect on the command at hand, but you would be wrong. Having this option checked effectively breaks the command, and while you can go through the motions, no change will take place.

To add insult to injury, having the Disjoin option disabled means you cannot clear the checkmark while trying to move a model pattern. The solution, as Steve reported, is to select an object for which the Move Disjoin option is active, such as a Wall, and select the Move tool. Clear the check mark at the Disjoin option on the Options bar, and then press the ESC key twice to exit the command without actually moving the selected object. Now you cah select the Ceiling grid or other model pattern and use the Move tool to reposition the pattern.

Here is a Screencast showing both the problem and the solution, that I put together for users in my office who would rather see the solution than read about it.

January 08, 2015

Dynamo: Text Padding Nodes

I made an interesting discovery the other day, just as I was finishing up my article on zero-padding for an integer-to-string conversion. And while I do not regret the effort I put into developing the custom nodes to achieve that result, as I am still very much in learning mode, and that gave me a task in which I had some interest, I would be remiss if I did not pass along this "discovery".

In the Dynamo out-of-the-box Library, there are two nodes that, similar to my custom node, will "pad" a string to a specified length, using the character (or characters) of your choice. These can be found under Core > String > Actions, and are called PadLeft and PadRight.

In the image above, the same input is provided to each of these nodes, and the newWidth input is provided with a list of values, resulting in a list of results, so you can see the effects. The str input is "ABC" and a multi-character string, "wxyz" is used for the padChars input. As you can see, the PadLeft node adds padding characters to the left side of the string; the PadRight node adds padding characters to the right side of the string. Just like my custom node, if the length of the initial string is the same or greater than the newWidth value, the original string is passed through unmodified.

Unlike my custom node, you can specify any string to be used for padding. If the padding string has more than one character, then Dynamo uses the first character of the string when one character is required for padding, the first two characters when two characters are required, and so on. If the required number of characters for padding exceeds the length of the padChars string, as many instances of the full string plus a partial string with as many characters starting with the first as needed to bring the final string to the specified length will be used.

The Screencast below shows how the PadLeft node can be used to do the same thing as my custom node.

The lesson to be learned here is, prior to embarking on a programming task in Dynamo, take a careful look at what is provided out-of-the-box (as well as in "packages" of custom nodes that can be downloaded) to see if some or all of what you need to do is already available.

January 07, 2015

Dynamo: New Stable Build Available

Dynamo Version 0.7.5 is now available for download from the Dynamo download page.

January 06, 2015

Dyanmo: Custom Node, Integer To String - Zero Padding

Having created a node that would convert an integer to a string, padding a single-character string to two characters by adding an initial "0" so that a YYYYMMDD date string could be generated, it occurred to me that having a more general purpose node, where you could specify the number of characters to which the string should be zero-padded, would be more useful. As with the two-character node, no effort is made to truncate the original string if it exceeds the specified length, but strings with fewer characters will have the necessary number of zero characters ("0") added to the front of the string to bring it up to the specified number of characters.

As seen in the short Screencast below, the custom node takes two numeric inputs, the number of characters to which zero-padding is to be applied and an "integer" [see note at end of article] that is to be converted to a string, with zero-padding as necessary. In the Dynamo file I set up to demonstrate the custom node, an Integer Slider node (in the Library, Core > Input > Integer Slider) is used to specify the number of digits desired and a Number node (Core > Input > Number) is used to provide the integer to be converted to a string. Note that the Run Automatically toggle is checked, so as changes are made, the results are calculated and displayed without having to press the Run button each time.

Integer To String - Zero Padding Node
The image above shows the graph of the Integer To String - Zero Padding custom node. A description of the graph function follows.
  1. The integer to be converted to a string is processed by the Math.Floor node (Core > Math > Actions > Floor) to remove any fractional part (see note below) prior to being passed to the ToString node (Builtin Function > ToString), which converts it to a string.
  2. The integer string created in Step 1 is passed to a String.Length node (Core > String > Actions > Length), which returns the string length as an integer. A custom node called Zero Padding String takes the Final String Length as input to the Integer To String - Zero Padding custom node, and the string length of the integer string and returns a string containing the zeros that need to be added to the front of the integer string (if any). See below for the graph of this custom node.
  3. The zeros string from Step 2 is concatenated onto the front of the integer string from Step 1 by a String.Concat node (Core > String > Actions > Concat), which is then passed as the output of the Integer To String - Zero Padding custom node. Note that if the length of the Step 1 integer string is greater than or equal to the Final String Length, the zero string will be an empty string, and the end result will be equivalent to the Step 1 integer string.

Zero Padding String Node
The image above shows the graph of the Zero Padding String custom node. A description of the graph function follows.
  1. The easiest way to explain how this graph functions is to start with the LoopWhile node (Builtin Functions > LoopWhile). The LoopWhile node takes three inputs: init, the intial state of the object being processed; continueWhile, the test condition that determines whether or not the current object being processed should be processed again; and loopBody, which defines what action(s) are taken on each pass of the loop.
  2. The init input is provided by a Code Block node (Core > Input > Code Block; or double-click in the graph canvas). Code Blocks allow for custom scripting in Dynamo; in this case, it is being used to simply generate an empty string. A String node (Core > Input > String), with the input left blank, could also have been used; I felt that seeing the two double quotation mark characters, with no other characters in between, in the Code Block made the node read better. I also double-clicked on the Code Block title and renamed it to "Empty String" to more clearly indicate its purpose.
  3. The continueWhile input is the most complicated. A - [Subtraction] node (Operators > -) calculates the difference between the Final String Length input and the Starting String Length. If this is a positive number, it represents the number of zero characters needed in the final padding string. We want to compare the length of the current string to this number, and continue to process the string if the current string length is less than the desired string length. This comparison is done by the < [Less Than] node (Operators > <), and the current string length is generated by the String.Length node. For reasons beyond my current understanding, the output of the String.Length node cannot simply be put into the x input of the < node, and the result of that fed to the continueWhile input. The continueWhile input requires a single function as the input, and so a Function.Compose node (Core > Evaluate > Function.Compose) is used to combine these nodes in a way that is acceptable as input for the continueWhile input. The + and - buttons on the node allow you to add or remove function inputs so that you have the correct amount for your application. In this case, the initial default of two inputs was what was needed.
    You may have noticed that both the < and String.Length nodes have unconnected inputs. The LoopWhile node presumes that you will be doing something to whatever is passed to the init input, in this case, a string, and will supply that value to any open input of matching type. Likewise, the Function.Compose node supplies the integer value passed to the func0 input by the String.Length node to the open x input of the < node. Also note that by including the current value of the processed object in the evaluation, we make it possible for the the comparison to eventually be false, and for the loop to terminate. Failure to do so would result in an infinite loop, which is not a good thing.
  4. The loopBody input is fairly straightforward. Another Code Block node, renamed to "Zero String" creates a string with a single zero character in it. This is the input to the string0 input of a String.Concat node. The string1 input is left open, so the processed object string will be supplied here. Each time the loop body is entered, a zero character will be added to the front of the current processed object string, making it one character larger. Eventually, the processed string length will be equal to the difference between the Final String Length and the Starting String Length, the loop will terminate and the final result will be a string with the proper number of zero characters.
  5. To summarize, the loop starts with an initial value of an empty string. The length of that empty string (0) is compared to the difference between the Final String Length and Starting String Length inputs, to see if it is less than the difference. If that difference is 0 or a negative number, then the value fed to the continueWhile input is false, no action will be taken, and the result of the custom node will be an empty string. If the difference is 1 or greater, then the value fed to the continueWhile input is true, and the loop body code will be run, adding a zero character to the empty string. The loop process is then run again, but this time the current value is not an empty string but "0", and the string length is 1. If the difference is 1, then the less than condition is false and the "0" string is passed to the output of the custom node. Otherwise, the loop body is run again and "00" becomes the new current value of the string. This continues until the string length is not less than the difference, at which point the loop terminates and the current string value becomes the custom node result.


NOTE: I put "integer" in quotation marks when describing the node input above because while that is the intended input, both inputs will accept a double (precision real number), with a non-zero fractional value, as input. For the number to be converted, any fractional part is discarded prior to the conversion to a string. The way the Final String Length value is used, any fractional amount will be the same as specifying the next higher integer. If a given application could generate a value with a fractional amount as the input for the Final String Length and only the whole number value is desired, the Math.Floor node should be used to strip the fractional amount. This works for non-negative numbers; the function returns the first integer that is lower than the input value. For negative numbers, this will change the units number. So 1.9 becomes 1, but -1.1 becomes -2. I was not expecting to be using zero-padding on negative numbers; if you have an application that would require that, then you may want to modify the code to accommodate that. Note also that the sign ("-") counts as a character after a negative number is converted to a string. If you want the zero padding of a negative number to be calculated without including the "-" sign in the number of characters, the code would have to be modified to account for that.