BoQExtra

Short description

๐Ÿš€ BoQExtra is an AutoCAD and Civil 3D C# .NET plugin for Bill of Quantities automation, length and area calculation, dynamic block counting, model-space selection control, object-field MTEXT output, clipboard formulas, and CSV or TXT export. The plugin helps CAD technicians, Civil 3D designers, BIM coordinators, and infrastructure drafting teams create faster, cleaner, and more traceable BoQ data directly from DWG geometry and block references.

Short description

๐Ÿš€ BoQExtra is an AutoCAD and Civil 3D C# .NET plugin for Bill of Quantities automation, length and area calculation, dynamic block counting, model-space selection control, object-field MTEXT output, clipboard formulas, and CSV or TXT export. The plugin helps CAD technicians, Civil 3D designers, BIM coordinators, and infrastructure drafting teams create faster, cleaner, and more traceable BoQ data directly from DWG geometry and block references.

Image 000 21

Command:

๐Ÿš€ Load the plugin with NETLOAD, select BoQExtra.dll, and run the command BoQExtra inside AutoCAD or Civil 3D.

๐Ÿงฉ Main project files include BoQExtra.csproj, Commands.cs, MainForm.cs, LengthAreaEngine.cs, BlockCounterEngine.cs, SelectionEntityTools.cs, PreviewControl.cs, ProfileManager.cs, and AcadFieldBuilder.cs.

๐Ÿ“Œ Main workflow: load BoQExtra.dll, open the modeless interface with BoQExtra, select drawing entities or block references, review the Length and Area table or Blocks table, validate the preview, copy formulas, place MTEXT results in model space, edit layers or polylines, and export quantity data for BoQ documentation.

๐Ÿงฐ Target platform: AutoCAD and Civil 3D using .NET Framework 4.8 and the AutoCAD managed .NET API.

Description:

๐Ÿ“ BoQExtra is designed for AutoCAD and Civil 3D projects where users need reliable quantity takeoff, geometry measurement, block counting, layer control, drawing validation, and Excel-ready formulas without repeating manual drafting and spreadsheet work. The tool focuses on model-space objects and block references, making it practical for construction drawings, utility plans, cable routes, drainage details, KTB layouts, KAS symbols, Civil 3D production sheets, and infrastructure BoQ workflows.

๐Ÿ“Š In the Length and Area tab, the user can select supported AutoCAD geometry by layer, by screen selection, or directly from the table. The plugin calculates object type, layer, handle, length, area, closed polyline state, per-entity minimum length, per-entity maximum length, and repeated vertical dimension values. It supports common drawing objects such as lines, 2D polylines, lightweight polylines, 3D polylines, arcs, circles, splines, and ellipses.

๐Ÿงฉ In the Blocks tab, the user can count all block references or only selected block references. The plugin displays block name, visibility state, count, unique block-name counters, object handle, dynamic block status, and xref status. A dedicated bottom counter summarizes each unique effective block name, so users can immediately see how many instances of manhole blocks, KAS blocks, connection blocks, cable-route blocks, or custom CAD library blocks exist in the filtered table.

๐Ÿ“ The plugin generates clipboard-ready formulas and drawing-ready MTEXT output. It can copy raw values, detailed expressions, CEILING formulas, profile-based formulas, raw length formulas, raw area formulas, and field-based formulas linked to object handles where possible. This improves BoQ traceability because the user can keep both the result and the calculation logic instead of manually typing static numbers.

๐Ÿ” The integrated preview system shows selected objects and surrounding context geometry, supports white background display, UCS-oriented preview rotation, mouse-wheel zoom, pan, fit all, fit selected, and model-space zoom actions. Selection in the table can also synchronize with AutoCAD model space selection, which helps users visually confirm exactly which drawing objects are being measured or counted.

๐Ÿง  The plugin is useful inside Civil 3D drawings that may also contain Alignment objects, ProfileView objects, SectionView objects, labels, bands, styles, corridors, pipe networks, surfaces, parcels, and production annotations. BoQExtra does not directly modify ProfileView, SectionView, Alignment, labels, bands, or styles. Its role is to measure and manage model-space entities, layers, block references, field text, preview data, and export tables that support Civil 3D quantity extraction and drawing quality control.

Helper function: (if any)โ€‹

  • ๐Ÿง  Command registrationCommands.cs registers the AutoCAD command BoQExtra and opens a modeless WinForms interface so the user can continue working in the DWG while the quantity tool remains active.
  • ๐Ÿ“ Length and area extractionLengthAreaEngine.BuildRows reads selected entities, resolves object handles, detects layers and entity types, calculates length and area values, and prepares preview geometry for CAD quantity takeoff.
  • ๐Ÿ“Š Per-entity dimension logic – the length engine calculates per-object Min L, Max L, Min V, and closed polyline state so the table shows object-level geometry data instead of only global totals.
  • ๐Ÿงฉ Block counter systemBlockCounterEngine counts block references by effective block name, visibility state, handle, dynamic flag, and xref flag, then builds robust preview footprints for dynamic and nested block workflows.
  • ๐Ÿ”ข Unique block counters – the Blocks tab builds a bottom summary grouped by effective block name, making repeated CAD symbols easier to review, copy, export, and verify for BoQ schedules.
  • ๐Ÿท๏ธ Profile managerProfileManager stores editable BoQ formula profiles under %APPDATA%\BoQExtra, including decimal rules, formula formatting, CEILING rules, and automatic Profile_002 layer detection.
  • ๐Ÿ“Œ Automatic Profile_002 profile detectionProfile.TryCreateKkProfileFromLayer detects layer tokens such as 220X275, 400X275, 515X275, and 700X285, then applies the matching divisor for area-based formulas.
  • ๐Ÿ“ AutoCAD object-field builderAcadFieldBuilder creates object-field formula terms when possible, allowing placed MTEXT results to reference drawing object properties instead of becoming only disconnected static text.
  • ๐Ÿงน Selection editing toolsSelectionEntityTools supports selected entity deletion, layer changes, closed-polyline toggling, polyline closing, polyline joining, and parallel polyline closure without launching an extra DCL dialog.
  • ๐Ÿ” Preview controlPreviewControl draws highlighted selected entities, gray context entities, block footprints, insertion markers, UCS-oriented geometry, fit selected, fit all, zoom, and pan while protecting against GDI overflow from extreme drawing coordinates.
  • ๐Ÿ“ค Export and clipboard logic – the plugin copies selected formulas, table data, unique block counters, and log data to the clipboard and exports CSV or TXT files for Excel, QA review, WordPress documentation, and project quantity records.
  • ๐Ÿ” Runtime diagnosticsRuntimeInfo and AppLog record build version, loaded DLL path, AutoCAD version, Civil 3D assembly availability, active drawing path, warnings, errors, and user actions for troubleshooting.

Functionalities:

  • ๐Ÿš€ Modeless AutoCAD interface – opens with BoQExtra and stays available while the user works in the drawing.
  • ๐Ÿ“ Length and area measurement – calculates geometry quantities from selected AutoCAD and Civil 3D model-space objects.
  • ๐Ÿ”ข Per-object quantity table – displays handle, layer, object type, length, area, closed status, minimum length, maximum length, and repeated vertical dimensions.
  • ๐Ÿง  Formula profiles – applies saved BoQ formulas, decimal formatting, Excel-ready expressions, CEILING rounding, and automatic Profile_002 layer divisors.
  • ๐Ÿ“ Field-based MTEXT placement – places raw, length, area, length plus area, detailed, CEILING, or profile-based results into AutoCAD as MTEXT.
  • ๐Ÿ“‹ Clipboard output – copies formulas, raw values, selected table data, block counts, unique counters, and logs for quick reuse in Excel or project documentation.
  • ๐Ÿงฉ Dynamic block counting – counts block references by effective name, visibility state, dynamic status, xref status, and individual handle.
  • ๐Ÿ”ข Bottom unique block counter – shows each unique block name and its total number of visible instances in the current filtered block table.
  • ๐Ÿท๏ธ Dynamic visibility editing – changes selected dynamic block visibility states directly from the Blocks tab.
  • ๐ŸŽจ Layer management – changes the layer of selected geometry or selected block references using wildcard-filtered layer lists.
  • ๐Ÿงน Delete and undo tools – deletes selected entities or block references and provides undo access in both main tabs.
  • ๐ŸŸง Polyline cleanup actions – closes selected polylines, joins selected polylines, and closes two selected parallel polyline rows without centerline creation.
  • ๐Ÿ” Model-space selection synchronization – selecting multiple rows in the grid can also select the corresponding objects in AutoCAD model space.
  • ๐Ÿ“Œ Model-space zoom control – zooms to the current row, selected rows, or selected model-space objects for visual checking.
  • ๐ŸŽจ Preview with drawing context – shows selected geometry in highlight color and unselected context geometry in gray, with UCS rotation, zoom, pan, fit selected, and fit all.
  • ๐Ÿ“ค CSV and TXT export – exports Length and Area tables, Blocks tables, unique block counters, and logs for downstream reporting and QA workflows.
  • ๐Ÿ”’ Diagnostic logging – records startup checks, build information, active drawing path, Civil 3D assembly detection, action history, warnings, and errors.

Result:

โœ… The final result is a productivity-focused AutoCAD and Civil 3D quantity takeoff plugin that combines geometry measurement, dynamic block counting, formula generation, field-based MTEXT placement, preview validation, entity editing, model-space synchronization, and export automation in one interface.

๐Ÿš€ BoQExtra reduces repetitive manual measurement, prevents copy-paste mistakes, improves BoQ traceability, speeds up block and layer checking, and helps users create cleaner construction quantity documentation with fewer manual steps.

๐Ÿ” Important configuration note: the project targets .NET Framework 4.8 and requires AutoCAD or Civil 3D managed API references through AutoCAD_Civil3D_references.props or a user-specific ObjectARX reference path. Profiles and logs are stored in %APPDATA%\BoQExtra.

Images, animations etc.

Image 000 21
Image 001 10
Image 002 6
Pixel

XAML code:

๏ปฟ<ResourceDictionary
 xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
 xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
 xmlns:src="clr-namespace:Autodesk.Windows;assembly=AdWindows">
 
 <src:RibbonToolTip x:Key="3DF_to_3DPoint">
 <src:RibbonToolTip.ExpandedContent>
 <StackPanel>
 <TextBlock Background="AntiqueWhite" TextAlignment="Left">
<Bold>Function Syntax: 3DF_to_3DPoint</Bold>
<LineBreak/>
<Hyperlink>https://www.cadforum.cz/en/download.asp?fileID=967</Hyperlink>
<LineBreak/>		
<Bold>Description</Bold><LineBreak/>
This AutoLISP command converts each selected 3DFACE into four AutoCAD POINT entities placed at the faceโ€™s vertex coordinates, preserving the original 3DFACE by default. It wraps the work in a single UNDO group and restores CMDECHO afterward. <LineBreak/>

<Bold>Command name</Bold><LineBreak/>
<Span Foreground="DarkRed">3DF_to_3DPoint</Span> (type this at the command line) <LineBreak/>

<Bold>What the user does</Bold><LineBreak/>
โ€ข Run <Span Foreground="DarkRed">3DF_to_3DPoint</Span> and select one or more 3DFACE objects when prompted. <LineBreak/>

<Bold>Main steps performed</Bold><LineBreak/>
โ€ข Temporarily disables command echo: <Span Foreground="DarkRed">(setvar "CMDECHO" 0)</Span>. <LineBreak/>
โ€ข Starts an UNDO group: <Span Foreground="DarkRed">(command "_UNDO" "_G")</Span>. <LineBreak/>
โ€ข Prompts for a selection set filtered to 3DFACE: <Span Foreground="DarkRed">(ssget '((0 . "3DFACE")))</Span>. <LineBreak/>
โ€ข For each 3DFACE, extracts its four vertex points using group codes <Span Foreground="DarkRed">10</Span>, <Span Foreground="DarkRed">11</Span>, <Span Foreground="DarkRed">12</Span>, and <Span Foreground="DarkRed">13</Span>. <LineBreak/>
โ€ข Places a POINT at each vertex: <Span Foreground="DarkRed">(command "_point" pt1)</Span>, <Span Foreground="DarkRed">pt2</Span>, <Span Foreground="DarkRed">pt3</Span>, <Span Foreground="DarkRed">pt4</Span>. <LineBreak/>
โ€ข Optionally you can delete the original 3DFACE by uncommenting <Span Foreground="Red">(entdel hnd)</Span>. <LineBreak/>
โ€ข Optionally you can draw a closed 3D polyline around the vertices by uncommenting <Span Foreground="Red">(command "_3dpoly" pt1 pt2 pt3 pt4 "_C")</Span>. <LineBreak/>
โ€ข Prints a small completion note: <Span Foreground="DarkRed">", Done."</Span>. <LineBreak/>
โ€ข Ends the UNDO group: <Span Foreground="DarkRed">(command "_UNDO" "_E")</Span>. <LineBreak/>
โ€ข Restores the original CMDECHO value and exits quietly. <LineBreak/>

<Bold>Result</Bold><LineBreak/>
You will see POINT entities at each corner of every selected 3DFACE while the original faces remain unchanged unless you enable deletion, and all actions are grouped for a single undo. <LineBreak/>

<Bold>Key functionalities</Bold><LineBreak/>
โ€ข Create POINT markers at the four vertices of each selected 3DFACE. <LineBreak/>
โ€ข Keep or remove the source 3DFACE based on whether <Span Foreground="Red">(entdel hnd)</Span> is uncommented. <LineBreak/>
โ€ข Optionally generate a closed 3D polyline outline of the face using <Span Foreground="Red">_3dpoly</Span>. <LineBreak/>
โ€ข Batch process multiple 3DFACE objects in one run. <LineBreak/>
โ€ข Safe operation via UNDO grouping and restoration of system state. <LineBreak/>

<Bold>Important implementation notes</Bold><LineBreak/>
โ€ข Selection filter is restricted to 3DFACE only: <Span Foreground="DarkRed">(0 . "3DFACE")</Span>. <LineBreak/>
โ€ข Vertex extraction relies on standard DXF group codes: <Span Foreground="DarkRed">10</Span>, <Span Foreground="DarkRed">11</Span>, <Span Foreground="DarkRed">12</Span>, <Span Foreground="DarkRed">13</Span>. <LineBreak/>
โ€ข POINT display depends on your PDMODE and PDSIZE settings. <LineBreak/>
โ€ข The optional lines are commented; remove the leading semicolons to activate them. <LineBreak/>
</TextBlock>
 
 <!-- Use MediaElement for GIF (static first frame) and Image as fallback -->


 
 </StackPanel>
 </src:RibbonToolTip.ExpandedContent>
 </src:RibbonToolTip>
</ResourceDictionary>

Additional info:

Share this page:

Tags: ๐Ÿท๏ธ Autocad Lisps, ๐Ÿท๏ธ BoQ_menu