July 31, 2020

Emojis in File Names

File this one under, "Just because you can, does not mean you should."

A colleague had called my attention to the fact that, in Windows 10, you are allowed to use emojis in file names. (Press the Window key + . to call up a dialog that allows you to select one.) I was pretty sure AutoCAD would have a problem with that, but I was surprised to find that I was able to create a file called ­čŹĽ.dwg and AutoCAD had no problems with it.

 



I do not recommend doing this with project files. I will also note that I did nothing beyond creating the file. I have not fully tested this. For example, I did not see what happens if I try to externally reference this file, or even just inserting it as a block into another file.

July 10, 2020

Dynamo: Building User Options into a Graph

The goal of the graph on which I was working when I needed to know how to add Shared Parameters to the Other Parameter Group was to allow a user to easily add additional shared parameters that we use to track issued Sheets in our Drawing List Schedule. Our template files have the first ten of these in them, and for some projects, that is enough. Others have many more than ten issuances, particularly those that track issuances during the design phases. We have twenty additional Shared Parameters in our Shared Parameter file; adding more than one of them is tedious, at best.

Using the Parameter.AddSharedParameter node from Erik Falck J├Şrgensen's Orchid package makes it easy to bulk-add Shared Parameters in a Dynamo graph. For this particular task, however, I wanted to be able to offer the end user the choice of adding the second group of ten parameters, the third group of ten parameters or both the second and third groups of ten parameters, without creating separate graphs for each group of ten additional parameters, and without the user having to go into the graph and make adjustments. My solution was to use a Python Script node to handle the user options. Two separate lists of the Shared Parameter names are created, and two Boolean nodes with Is Inupt set allow the user to choose to include one or both of those lists when the graph is run. The Python Script node has four inputs; two for the lists (IN[0] and IN[2]) and two for the Boolean nodes (IN[1] and IN[3]). The image below shows the simple Python code that gathers the input values and then tests the Boolean values, adding the associated list of Shared Parameter names to the output list if the Boolean is set to True.

In Dynamo Player, when the user finds the graph file and selects the Edit Inputs tool, this is what she or he sees:
Both Booleans are intially set to False. Should the user run the graph with both set to False, the Parameter List result will display the string to which the listOut variable is set if the list is empty: "Select at least one set of Parameters to add. " The user only needs to click on the "switch" displayed for each "Add Issues" Boolean to toggle it to True.

The switch turns green when set to True. Once the desired list(s) are set to True, selecting the Play tool will run the graph and the selected Shared Parameters will be added to the active project. The Parameter List result will display a list of the names of the Shared Parameters that were added.

As always, you can select an image to see it full size.

July 02, 2020

Dynamo: Other Parameter Group

Long time, no post. If anyone is still reading this blog, I hope you and your families are doing well in these trying times. A combination of being busy with work (remotely) and not having anything about which to write caused this rather long gap between posts.

I came across something today that I wanted to document for future reference. I was working on a Dynamo graph to automate the adding of specific shared parameters as project parameters in a Revit project file, using the Parameter.AddSharedParameter node from Erik Falck J├Şrgensen's Orchid package.

One of the required inputs is the Group under which the parameter will be organized. The particular parameters with which I was dealing are a continuation of ten that we already have in our project template files, and they are located under the "Other" group. The Select BuiltIn Parameter Group node that ships with Dynamo is used to generate the needed value, but PG_OTHER is not on the list from which you select. The first item on the list, INVALID, might not seem like something you would want to select, but in this case, that is the correct choice, to have the parameters created placed under the Other category.

March 01, 2020

ACA: Sheet Keynote Symbols

The out-of-the-box Sheet Keynote symbol in the US Imperial content features a hexagonal "tag" (not a Schedule Tag, but a Block-type Multileader that has a User Block assigned to it).
If your office standard is to use a differently shaped symbol, for whatever reason, that can be done; just follow the instructions that follow.
  1. You will need a non-annotative block to serve as the User Block of the Multi-Leader. The block will need to have a non-annotative Attribute Definition to hold the Sheet Keynote value, along with whatever other graphics you need. The Multileader that gets inserted can be annotative, if so specified in the Multileader Style; the User Block needs to be set up such that 1" in the Block Definition will end up plotting at the AutoCAD Architecture Annotation Plot Size when plotted for the active annotation scale assigned to the Multileader. Assuming that you want the Sheet Keynote text to plot at the Annotation Plot Size, it needs to be 1" high. Size the additional graphics to suit.
  2. The Attribute Definition's default value needs to be set up with a Field, that is set to show the Sheet Key value (only), as shown in the image below. Set the Field category to AEC Keynotes, the Field names to Sheet Key only, the Format to Uppercase and check the Insert as a placeholder toggle. Your field expression should look like what is shown in the image.
  3. You will need a Block-type Multileader Style that has the leader set up the way you want for your Sheet Keynotes. The Multileader Style can be set up to use your User Block, if you like; even if you do not, the settings in the Tool Palette tool that will be created to insert the Sheet Keynote will take care of setting your block as the User Block.
  4. You can make the process of creating the block definition with the required Field easier, by placing an instance of the out-of-the-box Sheet Keynote in the file where you are going to create the Block Definition. For the US Imperial content, that will bring in the SheetKey_Hexagon_na Block Definition. Insert an instance of this Block Definition, select it, right click and choose Copy Block Definition and Assign from the context menu. Enter a new name for your block. Now edit the block in place. Keep the Attribute Definition as is, and edit the hexagonal Polyline, or erase it and replace it with your own graphics. Inserting an instance of the out-of-the-box Sheet Keynote will also bring in the Block (Straight Leader) Multileader Style (US Imperial content). If you like that leader style, use it. If not, make your own or rename the Block (Straight Leader) Multileader Style and then edit it to create the leader you want. Keep the type set to Block.
  5. Save the file that contains your Block Definition and Multileader Style in a location that will be accessible to everyone who will need to make use of the Tool Palette tool that will reference this content. A shared network location is ideal for this, but you can also set it up on a local drive if everyone has the same location.
  6. Create a Sheet Keynote type Tool Palette tool for your content, on an editable Tool Palette. You can either copy the out-of-the-box tool and edit its properties, or add a copy of the one called Sheet Keynote in the Stock Tool Catalog > Drafting Tools. NOTE: Setting up an editable tool palette, and then sharing it with others is beyond the scope of this article. Perhaps I should write about that in the future.
  7. Right click on the Sheet Keynote tool, and choose Properties from the context menu. Edit the tool's properties to suit your needs. Give the tool a meaningful Name, that clearly indicates that this is your Sheet Keynote tool. You can include an extended description in the Description property; this will be shown in the tool tip when a user hovers over the tool. To have the tool use your content, set the Multileader style location and Symbol location properties to the path/file that holds your content, and then choose your content using the drop-downs in the Multileader style and Symbol properties. Verify that the Content type property is set to Block. Set any other properties as you prefer.
  8. Select the OK button to ratify the changes you made to the tool's properties.
  9. Start a new drawing, and test the new tool by selecting it, and verify that it places your Sheet Keynote Multileader correctly. Make any adjustments to the content or the tool properties as needed. If you do not have any AEC Content in the file from which a Sheet Keynote can pull the Keynote reference, you can press the ENTER key when prompted to select an object, and then manually choose a Keynote in the Select Keynote dialog.
  10. Place several Sheet Keynote symbols in your file, then use the out-of-the-box Document > Annotation > Sheet Keynote Legend tool, selecting your Sheet Keynotes, to verify that they show in the legend.

February 01, 2020

ACA: Property for Area of a Hatch Object

A question regarding tagging Hatch objects and being able to display the area of the hatch arose the other day. My initial response was, sure, that should not be a problem in AutoCAD® Architecture. Upon actually trying to do that, I found that there is no Area Automatic Property for Hatches. While that seems like an oversight, I then checked the object properties of Hatches and found that there is an Area property that is available through ActiveX. That is, no doubt, what drives the Area property of Hatches in the Properties palette. So while it was not quite as easy as I originally thought, it is possible to do, by creating a Formula Property that extracts the Area of the Hatch object to which the Property's Property Set is attached. Here is how to do that:

  1. Open the Style Manager, and create a Property Set Definition that applies to Hatch objects. I called mine HatchObjects (demonstrating my incredible creativity), and will use that name in the balance of this article. If you already have a Property Set that applies to Hatch Objects, you can add the required properties to it. If you name yours differently, substitute your name for HatchObjects wherever you see it here.
  2. In the HatchObjects Property Set Definition, create an Automatic Property that references the Handle Automatic Property source, if one does not already exist. Select the Add Automatic Property Definition tool on the Definition tab of the HatchObjects Property Set Definition (second from the top, at the left side of the tab, with the lightning bolt icon). Select the toggle to the right of the Hatch source to put a check mark in it, then select the OK button. I chose to leave the name of the property at the default value of Handle.
  3. In the HatchObjects Property Set Definition, create a Formula Property.
  4. Enter a name for the property in the Name edit box at the top; I used HatchArea (creativity gone wild).
  5. Uncheck the Use formula for description toggle (unless you really want the formula to be the description; I almost never do).
  6. Enter the formula in the Formula edit box. If you like, you can cut and paste the formula from the code box below. Note that the [Handle] text has to be a properly created reference to the Handle Property created in Step 2. That is done by selecting it in the Insert Property Definitions pane in the lower left corner of the Formula Property Definition dialog. You can substitute that for the pasted text, or you can follow the instructions in this blog article, if you like.
    Set acadApp = GetObject(,"AutoCAD.Application")
    Set hatchObj = acadApp.ActiveDocument.HandleToObject( "[Handle]" )
    RESULT = hatchObj.Area / 144.0
    When done correctly, the [Handle] text will have a light gray background and will be treated as one item, not individual characters. See image of dialog below.
  7. The formula is setting the variable acadApp to the AutoCAD Application, and then getting the Hatch Object associated with the value of the Handle property (which is the Hatch Object to which the Property Set is attached). The RESULT of the formula is then set to the value of the Area property of the Hatch, which will be a real number representing the area of the Hatch, in square drawing units. My sample file used imperial units, with one unit equal to one inch. Since I wanted the Area value in square feet, I divided the raw value by 144.0 to get square feet. If you are not using imperial units, or want to show the Area in some other area unit, adjust the RESULT line to do what is necessary to get the area value in the desired units.
  8. Your Formula Property Definition dialog should look similar to the image below. If so, select the OK button to save the changes to the HatchArea Formula Property.
  9. Back in the Style Manager, on the Definition tab, assign the desired Property Data Format to the newly created Formula Property.
  10. If you need additional properties for your Hatch Objects, you can add them now. When done, select the OK button to accept the changes made, close the Style Manager and return to editing the drawing.
  11. Attach the Property Set to one or more Hatches in your file. Select the Hatch and note the value of the Area property (under the Geometry category) on the Design tab of the Properties palette. Then select the Extended Data tab and verify that the value shown matches (allowing for any rounding/formatting of the value by the chosen Property Data Format).

January 09, 2020

Revit: New Ceiling Grid Pattern, Part 3 - Ceiling Type

First article in the series.
Previous article in the series.

In Parts 1 and 2, we created a Fill Pattern to define a grid pattern for an acoustic tile Ceiling, and then set up a Material that uses that Fill Pattern as a Surface Pattern. We will now assign that Material to the finish layer of a Compound Ceiling type.
  1. In the Project Browser, expand the Families node.
  2. Under the Families node, expand the Ceilings node. Then expand the Compound Ceiling node under that.
  3. Right click on the 2’ x 2’ ACT Compound Ceiling family type. Choose Duplicate from the context menu. If your project file does not have that type, choose another type used to show a grid-based acoustic tile ceiling.
  4. Give the duplicated type a meaningful name. I chose to call the example type 4-24x24_1-48x6 ACT System.
  5. Open a Ceiling Plan view that has an area to receive the new Ceiling Type. If the area does not already have a Ceiling, place one.
  6. Select the Ceiling, and, in the Properties palette, use the Type Selector at the top to change the selected Ceiling’s type to the newly created type.
  7. With the Ceiling still selected, in the Properties palette, select the Edit Type button.
  8. In the Type Properties dialog, verify that the newly created Ceiling Type name shows in the Type drop-down list. Then select the Edit button to the right of the Structure parameter, under the Construction category.
  9. In the Edit Assembly dialog, find the Finish 2 [5] layer under Core Boundary (line "4"). If you started with a different Ceiling Type that does not have a Finish 2 [5] layer, use the layer on the bottom, that will be exposed to the room below the Ceiling.
  10. Left click once in the Material column on the Finish 2 [5] line. This will highlight the name and cause a small button with an ellipsis icon (...) to appear at the right end of the column on that line. Select that button.
  11. In the Material Browser, find and select the Material you created in Part 2.
  12. Select the OK button to ratify the choice and dismiss the Material Browser dialog.
  13. In the Edit Assembly dialog, verify that the new material appears and that the value in the Thickness column for Finish 2 [5] is correct.
  14. Select the OK button in the Edit Assembly dialog to ratify the change to the material. Then select the OK button again to accept all of the changes to this ceiling type, dismiss the Type Properties dialog and see the effect on the selected ceiling.
  15. Synchronize the model to save the changes to the central file.

If you are using Basic Ceilings, rather than Compound Ceilings, you can still assign the Material created in Part 2. Instead of editing the Structure in the Type Properties dialog, you will assign the Material to the Material parameter under the Materials and Finishes category.

January 05, 2020

Revit: New Ceiling Grid Pattern, Part 2 - Material

First article in the series.

In Part 1, we created a custom Fill Pattern from a PAT file to define the grid pattern for an acoustic tile Ceiling. We will add that pattern to a Material in this article, so that it can then be assigned to the finish layer of a Ceiling in Part 3.
  1. On the Manage ribbon tab, on the Settings panel, select the Materials tool.
  2. For the purposes of this tutorial, all we care about is the Surface Pattern that will be seen in the contract documents, and the rendered appearance will not be adjusted. If that is also true for you, you can proceed by either creating a new Material from scratch or by duplicating one of the ceiling tile Materials and then editing the duplicate. I will take the latter approach here, as that way the new Material will inherit the graphic settings from the source material, maintaining consistency.
  3. In the Material Browser, find and select the Acoustic Ceiling Tile 24 x 24 material, which is part of the content supplied with the United States Imperial content in Revit. If you are working in a Metric file, choose an existing Material for a gridded ceiling.
  4. Right click on the material, and choose Duplicate from the context menu.
  5. Give the new material a meaningful name. For this example, I chose Acoustic Ceiling Tile 4-24x24_1-48x6.
  6. Select the Appearance tab. While we will not be setting a grid-specific render image for this Material, we do want to set the Material up with a unique Appearance Asset so that any future change made here will not affect other Materials, and any future change made to the Appearance Asset assigned to the Acoustic Ceiling Tile 24 x 24 Material (or any other Material using the same Appearance Asset) will not affect this Material. In the upper right corner, select the Duplicates this asset. tool. If successful, the name of the Appearance Asset will be changed (by adding a number in parentheses at the end) and the number next to the hand icon will be 0, indicating that this Appearance Asset is shared with no other Material. If you have a render image for this Ceiling, you would assign it here; that is beyond the scope of this tutorial.
  7. Select the Graphics tab.
  8. In the Surface Pattern area of the Graphics tab, select the image tile to the right of where it says Pattern.
  9. In the Fill Patterns dialog, verify that the Pattern Type is set to Model. Then find and select the Fill Pattern created in Part 1.
  10. Select the OK button to ratify the selection and dismiss the Fill Patterns dialog.
  11. In the Material Browser dialog, verify that the other settings on the Graphics tab are as desired. Assuming you want this ceiling pattern to appear the same one of the source Material (Acoustic Tile 24 x 24, or whatever Material you duplicated) (except for the Fill Pattern used), the settings should be correct.
  12. Select the OK button to add the new material to your project.

Part 3 will add the new Material to a Ceiling Type.

December 31, 2019

Revit: New Ceiling Grid Pattern, Part 1 - Fill Pattern

In order to have a new ceiling type with a "custom" ceiling grid pattern, you need a Fill Pattern that defines the grid pattern, a Material to which that Fill Pattern can be assigned as a Surface Pattern, and, finally, a Ceiling Type to which that Material can be assigned. While you can start by duplicating a Ceiling Type and drill your way through the various dialogs until you get to the point where you create a new Fill Pattern for the ceiling, and then drill your way back out, I am going to break the process down into three separate steps, so that each step serves as a tutorial for that operation and can be referenced when the need for that operation comes in a different context.

The first step is to create a Fill Pattern that defines the ceiling grid. I am assuming that you have a Fill Pattern file (PAT) that defines a Model type of pattern (as it represents a real-world object, a ceiling grid, that wants to hold the same dimensions, no matter the scale of the view in which it is seen). For the purposes of this example, I am using a custom Fill Pattern that is called Ceiling_4-24x24_1-48x6. It has four rows of 2'-0" x 2'-0" tiles, and then a row of 6" x 4'-0" tiles, as seen in the image below.
Here is how to make that PAT file pattern available in Revit, as a Fill Pattern.
  1. On the Manage ribbon tab, on the Settings panel, select the Additional Settings tool to deploy the menu, and then choose Fill Patterns from the menu.
  2. In the Fill Patterns dialog, set the Pattern Type to Model. Then select the New fill pattern tool.
  3. In the Add Surface Pattern dialog, set the Type to Custom. Then select the Browse button.
  4. In the Import Fill Pattern dialog, navigate to the location where you saved the Ceiling_4-24x24_1-48x6.pat file, and select it. Select the Open button.
  5. Back in the Add Surface Pattern dialog, verify that the Name is what you want (it will default to the pattern name) and the Import scale is set to 1.00 (since this is a model pattern, and the pattern was created at full size). Select the OK button to add the Fill Pattern and dismiss the Add Surface Pattern dialog.
    NOTE: This example uses a PAT file that only defines one pattern, so the desired pattern is already selected. If your desired pattern is in a PAT file that defines two or more patterns, then you will need to find and select your pattern in the list box to the left of the Browse button. Revit will only display patterns of the type selected (Model, here), and will sort them in the list alphabetically. The first pattern on the list will be selected initially, but that may not be the one you want. You can use the Search box above the list box to type in part of the pattern name you seek to make it easier to find, if the file contains a lot of Model patterns.
  6. You should see the newly added model pattern in the Fill Patterns dialog. Select the OK button to accept the added pattern and return to the Revit model.

Part 2 will cover creating a Material which will use the newly created Fill Pattern.

November 15, 2019

ACA-AMEP: Edit Property Data Via AutoLISP, Part 3

First article in the series.
Previous article in the series.

In the previous article, we used a while loop to examine each Property Set in the collection of Property Sets attached to the object of interest, comparing each Property Set's Name to the name of the Property Set that holds the Property whose value is to be changed. At this point, there are two possible conditions:
  1. A matching Property Set was found. The value in the Property Set counter variable, iPSet, was set to one more than the number of Property Sets in the collection (variable iPSets).
  2. A matching Property Set was not found. The value in the Property Set counter variable, iPSet, will be equal to the number of Property Sets in the collection (variable iPSets).
(cond    ; Cond A.
  ((= iPSet iPSets)
   ;; If the Property Set is not found after processing all attached property sets, issue prompt.
   (prompt
     (strcat
       "\nProperty Set "
       sPSet
       " not found on object passed to argument obj. "
     ) ;_ End strcat.
   ) ;_ End prompt.
   nil    ; Return nil.
  ) ;_ End condition A1.
  (T    ; Else, continue.
   (setq oProps (vlax-get-property oPSet 'Properties)
          ; Get Properties object of the Property Set.
         iProps (vlax-get-property oProps 'Count)
    ; Get number of Properties in the Property Set.
         iProp  0  ; Initialize Property counter.
   ) ;_ End setq.

   (while (< iProp iProps) ; While unprocessed Properties remain...
     (setq oProp   (vlax-invoke-method oProps 'Item iProp)
    ; Get current Property object.
    sPropNm (vlax-get-property oProp 'Name)
    ; Get Property name.
     ) ;_ End setq.
     (if (= (strcase sPropNm) (strcase sProp))
        ; If target Property found...
       (setq iProp (1+ iProps)) ; ...exit while loop.
       (setq iProp (1+ iProp)) ; ...else, increment Property counter.
     ) ;_ End if.
   ) ;_ End while.

   (cond   ; Cond A2B.
     ((= iProp iProps)
      ;; If the Property is not found after processing all Properties in the Property Set, issue prompt.
      (prompt
        (strcat
          "\nProperty "
          sProp
          " not found in Property Set "
          sPSet
          " attached to the object passed to argument obj. "
        ) ;_ End strcat.
      ) ;_ End prompt.
      nil   ; Return nil.
     ) ;_ End condition A2B1.
     (T    ; Else, update Property value with processed value.
      (setq varPropValOld (vlax-get-property oProp 'Value))

      ***** ADD CODE HERE TO GENERATE THE DESIRED NEW VALUE   *****
      ***** SET VARIABLE sPropValNew to the NEW DESIRED VALUE *****

      (vlax-put-property oProp 'Value sPropValNew)
      sPropValNew   ; Return new string value.
     ) ;_ End condition A2B2.
   ) ;_ End cond A2B.

  ) ;_ End condition A2.
) ;_ End cond A.

Here is what is happening in that code:
  • A cond statement is used to determine which of the two conditions noted above is active. The first test checks to see if iPSet and iPSets are equal. If this is true, then the target Property Set was not found, and there is nothing to process. A prompt is written to the command line to inform the user. I have a separate subroutine to hold this code, so after issuing the prompt, this condition returns nil to the calling routine, to indicate that the requested Property Set was not found. The calling routine can then choose how to handle that situation.
  • If iPSet and iPSets are not equal, then the target Property Set was found and we can continue on. The test for this condition is T (True), because if the first test is false, no further test is required, and the code to process will be contained within this condition.
  • Variable oPSet holds the Property Set object whose name matched the target Property Set name. The Properties property of the Property Set object is used to obtain the Properties collection of that Property Set. The Properties collection contains all of the individual Property objects that are defined in that Property Set Definition.
  • The Count property of the Properties collection is used to determine the total number of Properties in the collection (variable iProps). A variable to hold the Property counter, iProp is initialized to 0, the index of the first Property in the collection.
  • Similar to the way we iterated over the Property Set collection, a while loop is used to iterate over the Properties collection, looking for a Property whose name matches the target property name, which is held in variable sProp. If a match is found, iProp is set to one more than the total number of Properties in the collection. If a match is not found, then iProp is incremented by 1, so that the next Property in the collection will be processed on the next pass of the loop, if at least one unprocessed Proeprty remains.
  • At this point, there are two possible conditions:
    1. A matching Property was found, and the value of iProp is one more than the value of iProps
    2. A matching Property was not found, and the values of iProp and iProps are equal.
  • Once again, a cond statement is used to run the appropriate code. If a matching Property was not found, the first condition writes a prompt to the command line to inform the user that the Property was not found, and returns nil to the calling routine, to indicate that the requested Property was not found in the requested Property Set. The calling routine can then choose how to handle that situation.
  • If the target Property was found, then the first condition will not be executed, and the second condition will be executed, as the test is set to T.
  • The Value property of the Property object is used to obtain the current value, storing it in variable varPropValOld.
  • At this point, you will need to add the code that generates the new value for the target Property, saving that value to variable varPropValNew
  • The vlax-put-property function is used to push the new value onto the Value property of the Property Object. This condition then returns the new value to the calling routine.
  • All of the currently open conditions and cond functions are then ended.

If you choose to have all your code in a single AutoLISP command function, then instead of returning nil or varPropValNew at the end of the A1, A2B1 and A2B2 conditions, you would add whatever additional code you may feel appropriate to run prior to the end of your command function.

November 05, 2019

ACA-AMEP: Edit Property Data Via AutoLISP, Part 2

First article in the series.

In the previous article, we obtained a collection of the Property Sets on the object for which we want to change the value of a Property. We also determined the total number of Property Sets in the collection, and set up a Property Set counter, initialized to 0, the index of the first Property Set. The following code assumes that you know not only the name of the Property that is to be changed, but also the name of the Property Set in which it resides and that the name is stored in a variable called sPSet.
(while (< iPSet iPSets)  ; While unprocessed Property Sets remain...
  (setq oPSet   (vlax-invoke-method oPSets 'Item iPSet) ; Get current Property Set object.
        sPSetNm (vlax-get-property oPSet 'Name)         ; Get Property Set name.
  ) ;_ End setq.
  (if (= (strcase sPSetNm) (strcase sPSet))             ; If target Property Set is found...
    (setq iPSet (1+ iPSets))                            ; ...exit while loop.
    (setq iPSet (1+ iPSet))                             ; ...else, increment Property Set counter.
  ) ;_ End if.
) ;_ End while.

Here is what is happening in that code:
  • A while loop is used to iterate over the Property Sets collection. The Item method is used to get the Property Set at the current index value in iPSet.
  • The Name property of the Property Set object is used to obtain the name of that Property Set.
  • An if statement is used to determine if that Property Set name matches the target Property Set name. The strcase function is used to change both strings to all capital letters, to avoid any issues with different capitalization of the names. If a match is found, the iPSet index counter is set to a number one greater than the total numnber of Property Sets in the collection, so that the loop will be exited. If a match is not found, the iPSet index counter is incremented by 1, so that the next Property Set in the collection will be processed on the next pass of the loop, if at least one unprocessed Property Set remains.

Next article in the series.