![]() |
Junction Diagram Automation Suite 1.5.1
An AutoCAD 2024 plugin for the manipulation and generation of junction box wiring diagrams
|
The main application class for the Junction Box Automation tool. More...
#include <JBoxApp.h>
Public Member Functions | |
virtual bool | OnInit () |
Initializes the JBoxApp application. | |
void | BuildJunctionBox () |
Opens a dialog to configure and draw a junction box diagram. | |
void | FlipCable () |
Flips the orientation of selected cable or termination blocks in the drawing. | |
void | ReIndex () |
Recalculates and updates terminal numbers for selected junction-related blocks. |
Static Public Member Functions | |
static void | DrawJunctionBoxes (void *data) |
Draws one or more junction boxes in the active AutoCAD drawing. |
The main application class for the Junction Box Automation tool.
This class is responsible for initializing the application context and handling high-level operations such as building junction boxes and performing cable-related manipulations. It is built on top of the wxWidgets framework and integrates with AutoCAD.
void JBoxApp::BuildJunctionBox | ( | ) |
Opens a dialog to configure and draw a junction box diagram.
This method launches a UI dialog where the user can select the Excel file, choose the junction tag, and define the box size. It then draws the selected junction box (or all boxes if "Select All" is chosen) into the current drawing.
|
static |
Draws one or more junction boxes in the active AutoCAD drawing.
This function takes a pointer to a JBoxBuilderDialog instance, retrieves the selected junction tag and box size, and calls the appropriate JBox::Draw() method.
Behavior:
data | A JBoxBuilderDialog* pointer containing the user's configuration and IO list. |
void JBoxApp::FlipCable | ( | ) |
Flips the orientation of selected cable or termination blocks in the drawing.
This function toggles the horizontal orientation of supported block references, either by updating a dynamic block property (e.g., "Flip state") or by scaling the block geometry. In some cases, the block is repositioned horizontally to maintain layout consistency.
Supported flip behaviors:
Behavior:
|
virtual |
Initializes the JBoxApp application.
This method is called on application startup. It creates a wxWindow that wraps the AutoCAD main window to serve as a parent for UI elements.
void JBoxApp::ReIndex | ( | ) |
Recalculates and updates terminal numbers for selected junction-related blocks.
This function prompts the user to select AutoCAD block references representing junction terminations and reassigns their terminal numbers based on vertical position in the drawing. The cable block with the highest Y-coordinate is used as the reference point (first terminal), and subsequent blocks are indexed downward in 0.25 unit increments.
Supported blocks:
For each block, it modifies terminal-related attributes (e.g., FLDTAG1–FLDTAG9) based on standard spacing rules. The user is prompted to input the starting terminal number.
Behavior: