Tutorial: Working with Object Sets

This tutorial demonstrates the use of Object Sets in Project Explorer to simultaneously generate two broadly identical reports to a Microsoft Word DOCX file and a Microsoft Excel XLSX file. The use of object sets will allow you to easily ensure that the content of both files is kept in-sync, even after a design change.

Object Sets allow complex reports to be generated, featuring a range of content from a Civil 3D model. In this example, the report will include a pipe run between two specific structures on a pipe network, and a station based report of the gutter lines on a corridor.

Getting Started

In Autodesk Civil 3D, open the standard Civil 3D sample drawing: Intro-1.dwg

This drawing is part of the standard Civil 3D installation, and can generally be found in the following folder:

C:\Program Files\Autodesk\AutoCAD 2022\C3D\Help\Civil Tutorials\

About Object Sets

Object Sets allow you to create a selection of objects in a Civil 3D drawing. Object Sets are persistently remembered in each AutoCAD drawing.

Object Sets can have optional actions associated with them. Actions are generally configured to generate report files or to export data files. Filters can be applied to certain types of objects in an object set to (for instance):

  • Compare an alignment with another alignment in terms of offset/elevation/crossfall on a station by station basis.
  • A start and end structure to produce a pipe run report.
  • A comparison surface to show pipe depths at regular intervals in a pipe run report.
  • Specific point codes to restrict the types of feature line included in a corridor report.

Creating the first Object Set

  1. From the Civil 3D ribbon, select the Add-Ins tab and click Launch Project Explorer to open the Project Explorer window.
  2. Select the Object Sets tab in the Project Explorer window, then click the New Object Set button on the toolbar to start creating the first object set in the current drawing.

The Create Object Set dialog box opens.

Configuring the Object Set

To define an object set which generates a report, you need to create a file name, file type, and output path for the report, then configure the content and layout of the report using a Layout Style and a Report Style.

  1. Select Report to DOCX File from the Action drop down list.

    Note that the file name of the outgoing report file can be derived from a series of dynamic variables, or you can specify a fixed file name in this dialog. In this case, you'll use the default option, the outgoing file name will be made up of a combination of the object set name and the drawing name.

  2. Set the required Output Path if desired.
  3. Change the Layout Style setting to Use Specific Layout Style, then click the Edit button to start defining the layout of this report.

    The Layout Options dialog opens.

Layout Style Options

Layout Styles define the heading, visibility, and order of every column of data in the report. The units of numerical values can also be controlled from a layout style.

From this dialog you will define the layout style which will be applied to the outgoing report. Most importantly, you can choose to turn off some data columns from your report.

  1. On the Corridors tab of the Layout Options dialog box, ensure that Configure Column Layout for Corridor Feature Line Points is selected.
  2. From the list view, clear the following column labels:
    • Point
    • Region
    • Assembly
  3. On the Pipe Networks tab of the Layout Options dialog box, ensure that Configure Column Layout for Pipe Networks is selected.
  4. From the list view, clear the following column labels:
    • Structure Plan Label Style
    • Pipe Plan Label Style
    • Structure Plan Layer
    • Pipe Plan Layer
  5. Change the drop-down list to Configure Column Layout for Pipe Runs.
  6. From the list view, clear everything. Then, just select the following items:
    • Distance
    • Part Name
    • Easting
    • Northing
    • Invert Elevation Out
    • Invert Elevation
    • Invert Elevation In
    • Comparison Surface
    • Comparison Surface Elevation
    • Comparison Surface Cover/Depth
  7. At this point, you may rename or reorder any of the selected columns to match the standards in your organization. Columns may be renamed by double-clicking on the required label, or by right-clicking and selecting Rename from the right-click menu.
  8. Select the General tab and note the options here to set the format of numerical values such as angles/bearings, stations, elevations, and slopes.
  9. To use a specific layout style with an object set, you need to save these settings to a layout style and associate the resulting file with this object set.
  10. Click the Save button, and save the layout style to a path and file name of your choice.
  11. Click OK to close the Layout Options dialog and return to the Create Object Set dialog box.

Report Style Options

Next, you'll set up a Report Style to determine the page formatting, fonts, table style, and header/footer content of the outgoing report.

  1. In the Create Object Set dialog, under the Report Style section, press the Edit button.
  2. The Report Options dialog opens.

  3. On the Page Options tab, set the page size to A4, and the page orientation to Portrait.
  4. On the Font Options tab, set the preferred font to Corbel and the font size to 10pt.

  5. Save these settings to a Report Style and associate the resulting file with this object set. Click the Save button, and save the report style to a path and file name of your choice.
  6. Click OK to close the Report Options dialog and return to the Create Object Set dialog.

Note that you have now created references in your object set to the layout style and report style that you just defined.

Click OK to close the Create Object Set dialog. You have now completed setting up our first object set.

Next you will populate the object set with some objects.

Populating an Object Set

The objects that you place in your object set will determine the content of our generated report. In the next steps you will use two different methods to add objects to this object set.

To add a corridor from the Object Sets tab:
  1. On the Object Sets tab of the main Project Explorer window, click the Add/Remove Object(s) to/from Object Set button.
  2. On the Corridors tab of the resulting dialog, select the First Street corridor and click OK.

    Back in the main Project Explorer window you can see that First Street has been added to our Object Set.

  3. Optionally, you can now specify the corridor feature lines to include in your report by adding a point code filter. Click the Add/Edit Filter button to open the Sort and Filter Content dialog. Select the ETW point code and click OK.
  1. Open the Pipe Networks tab of the main Project Explorer window. From the main toolbar, set the start structure of the Pipe Network profile view to Structure - (2) and the end structure to Structure - (8). This determines the path and route of the displayed pipe run. Set the comparison surface of the pipe run to First Street - (1).
  2. Ensure that the Pipe Run sub-object category tab is selected, then right-click the selected pipe network from the list. From the right-click menu, select Add to Object Set (Pipe Run), then select Object Set - (1) from the related sub-menu. The selected pipe run is added to your object set.

  3. Return to the Object Sets tab to verify that there are now two objects listed in your object set.
  4. At this point, you can test the report creation process from your new object set by clicking the Run Selected Action button on the Object Sets tab of the main Project Explorer window.

  5. The report is generated. Open Microsoft Word to inspect the resulting report file. Note the inclusion of the ETW feature lines from the First Street corridor and the pipe run from the Storm Sewer Network pipe network.

Duplicating an Object Set

You can now use Object Sets to generate this report to two different file formats simultaneously. You can achieve this by duplicating this object set, and making a few edits to the duplicate.

  1. On the Object Sets tab of the main Project Explorer window, right click your existing object set and select Copy from the right-click menu.
  2. Right-click again and select Paste from the menu. You now have two identical object sets containing the same objects and filters.
  3. Double-click the new object set to open the Edit Object Set dialog, then change the Action to Report to XLSX File.
  4. Change the Object Set name from Object Set - (1) - Copy to Object Set - (1) to Excel.

  5. Click OK to close the Edit Object Set dialog box and return to the main Project Explorer window.
  6. Use the same technique to change the name of the first object set to Object Set - (1) to Word. You have now defined two Object Sets which are identical apart from the file type of the generated report.
  7. Click the Run All Actions button in the main toolbar. Actions are processed from all object sets in the drawing, which in this case will cause your report to simultaneously be written to a DOCX file and an XLSX file. Review the resulting files in Microsoft Word and Microsoft Excel.

Here is the resulting file as it looks in Microsoft Excel, with each object in the Object Set written to a separate worksheet:

To prevent the report header and footer from creating additional worksheets in the exported file, clear the Report Header and Report Footer options in the referenced Report Style and select Run All Actions again.

Project Explorer does not automatically set the width of columns in the exported Excel file. In Microsoft Excel, select the entire worksheet and select Autofit Column Width from the cell formatting options in the Excel ribbon.

The object sets that you've created in this tutorial currently share the same layout style and report style. This may or may not be preferable depending on how each report needs to be laid out. But in this case, it's worth being aware that making changes to those styles will affect the layout or style of the reports when they are next regenerated.

Save the current drawing.

What's Next?

Now that you have successfully configured two Object Sets in your drawing, both reports can be regenerated at any time simply by selecting Run All Actions in the Project Explorer window.

A few things you could try:

  1. Try applying some design changes to your Civil 3D model then regenerate the reports to review the effect of those design changes.
  2. Try reconfiguring the data columns in these reports by editing the Layout Style which is associated with the two object sets. Regenerate the reports to review the effect of these changes.
  3. Try changing the style of these reports by editing the Report Style which is associated with the two Object Sets. Regenerate the reports to review the effect of these changes.

In the next tutorial you'll use the editing capabilities of Project Explorer to modify the pipe network and corridor referenced in these reports, then you'll use the Run All Actions option to instantly update both reports.