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.
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 2020\C3D\Help\Civil Tutorials\
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):
The Create Object Set dialog box opens.
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.
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.
The Layout Options dialog opens.
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.
Next, you'll set up a Report Style to determine the page formatting, fonts, table style, and header/footer content of the outgoing report.
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.
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.
Back in the main Project Explorer window you can see that First Street has been added to our 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.
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.
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:
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.