Please provide your e-mail address to download your FREE 30-day trial.
This tutorial demonstrates the use of Object Sets in ProjectExplorer 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 us 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 channel 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 2018\C3D\Help\Civil Tutorials\
Object Sets allow us to nominate a selection of objects in a Civil 3D drawing. Object Sets are persistently remembered in each AutoCAD drawing.
Crucially, 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 opens.
To define an object set which generates a report, we need to nominate 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.
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 we will define the layout style which will be applied to the outgoing report. Most importantly, we want to disable some data columns from our report to avoid the output from becoming too crowded on the page.
Next, we'll set up a Report Style to determine the page formatting, fonts, table style, and header/footer content of the outgoing report.
In the Create Object Set dialog, under the Report Style section, press the Edit button.
The Report Options dialog opens.
Note that we have now created references in our object set to the layout style and report style that we just defined.
Press OK to close the Create Object Set dialog. We have now completed setting up our first object set.
Let's now populate the object set with some objects.
The objects that we place in our object set will determine the content of our generated report. Let's explore two different ways to add objects to this object set.
We would like to use Object Sets to generate this report to two different file formats simultaneously. We 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, deselect the Report Header and Report Footer options in the referenced Report Style and select Run All Actions again.
ProjectExplorer 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 we'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 AutoCAD drawing. You have now completed this tutorial.
Now that we have successfully configured two Object Sets in our drawing, both reports can be regenerated at any time simply by selecting Run All Actions in the ProjectExplorer window.
A few things you could try:
In the next tutorial we'll use the editing capabilities of ProjectExplorer to modify the pipe network and corridor referenced in these reports, then we'll use the Run All Actions option to instantly update both reports.