Skip to content

schauh11/pySC

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pySC

Professional electrical engineering tools for pyRevit.

pySC is a pyRevit extension that provides productivity tools for electrical engineers working in Autodesk Revit. It focuses on circuit management, conduit sizing, panel schedule analysis, and annotation workflows.

Features

Electrical

Circuit Tools

  • Circuit Devices - Interactive session tool that guides you through assigning electrical fixtures to panel circuits while tracking real-time load (VA) and enforcing capacity limits. Features a floating HUD displaying current circuit number, voltage drop percentage, and device assignment status with full undo support.
  • Move Circuit - Relocates an existing circuit within its panel schedule to a different slot without re-creating it. Detects available slots, handles space/spare removal, and includes safety checks for locked slots and multi-pole breakers.
  • Select Unpowered - Identifies all electrical devices (fixtures, equipment) in the document or active view that lack circuit assignments. Selects them visually in Revit for batch-circuiting or design team review.
  • Circuit All Connectors - Creates one circuit per uncircuited electrical connector on multi-connector devices like furniture feeds, then assigns all circuits to a selected panel.
  • Wire All Circuits - Draws homerun wires for every power circuit visible in the active floor plan or ceiling plan in one batch operation. Automatically disables tick marks and skips circuits that already have wiring.

Calculators

  • Voltage Drop - Calculates voltage drop using resistance (NEC Table 9) or impedance (R + jX) methods with three modes: VD percent for a given wire size, minimum conductor size to meet a VD limit, or maximum circuit distance for a target wire. Includes conduit fill validation and upsize recommendations.
  • Conduit Size - Determines if a conduit trade size passes NEC fill requirements for a given set of conductors, accounting for 1-, 2-, or 3+ conductor fill percentages and nipple exceptions. Recommends next-size-up conduit when fill fails.

Panel Tools

  • Panel Schedule - Creates panel schedules for electrical panels that don't have them, and synchronizes panel element names with their corresponding schedule view names to keep the project browser organized.
  • Phase Balance - Scans all electrical panels in the document, calculates per-phase load imbalance percentages, sorts by severity, and allows you to open individual panel schedules or export results to CSV.
  • Spaces & Spares - Adds or removes empty circuit spaces and spare breaker slots on a panel schedule, with support for single-pole and 3-pole breaker configurations.

Conduit Tools

  • Bend Total - Analyzes conduit runs, calculates total bend angles from all fittings in each run, and flags components exceeding 360 degrees (UL 514B limit). Highlights over-bent runs for redesign.

Fire Alarm

  • Check Coverage - Selects fire alarm devices, reads their candela values, calculates required coverage areas using NFPA reference tables, and draws filled regions showing coverage zones on the active view.

Annotation

Cleanup

  • Align Leader Elbows - Aligns annotation leader elbows to a common vertical position, separately for left and right leaders. Offers three modes: align elbows only, align text positions only, or both.
  • Delete Empty Tags - Scans the current view to find and delete empty tags (displaying "?") and orphaned/unhosted tags with a hierarchical selection dialog organized by category and family.
  • Link Cleaner - Hides specific categories (Grids, Levels, Scope Boxes, Matchlines, Reference Planes) from all visible linked models in the active view to reduce visual clutter.

Find

  • Find - Advanced element discovery across models, active views, or selections using a multi-level category/family/type tree with optional parameter-based filtering (text, numeric, and range comparisons). Isolates or selects matching elements with automatic zoom.
  • Duplicates - Detects overlapping or duplicate elements using spatial indexing, supporting both model geometry (by location proximity) and annotations (by bounding box overlap). Reports results with clickable links.
  • Select Tags by Text - Filters and selects tags, text notes, or dimensions based on text pattern matching with operators like contains, starts with, equals, and numeric comparisons, with a live preview counter.

Layout

  • Duplicate to Levels - Copies floor plan and ceiling plan views from a source level to multiple target levels in one operation, with options to preserve scope boxes and view templates. Optionally places duplicated views on new sheets.
  • Orient to View - Aligns a 3D view's camera and section box to match a selected 2D view (floor plan, elevation, section) or scope box, with a searchable interface organized by view type.
  • Views on Sheets - Places multiple floor plan views onto new sheets using actual measured viewport dimensions for optimal packing, supporting one view per sheet or dimension-based multi-view packing.

Rooms

  • Renumber - Automatic or manual sequential numbering of elements with spatial clustering (left-to-right, top-to-bottom reading order), filtering by family/type/parameters, and prefix/suffix options.
  • Tag Selection - Tags only your pre-selected elements by category with specific tag types, bridging the gap between Revit's all-or-nothing Tag All and manual one-by-one tagging.
  • Linked Rooms - Creates floor plans, interior elevations (4 per room), and 3D section views from rooms in linked architectural models, with optional automatic sheet placement.

Datums

Grid Tools

  • Copy - Captures grid bubble visibility, leader positions, and extent parameters from all grids in the active view for replication to other views.
  • Paste - Applies previously copied grid display state (bubbles, leaders, extents) to matching grids in the active view.
  • Batch Paste - Extends paste to multiple views at once with filtering options (same scope box, same scale, keyword search).
  • Align Grids - Converts grids to 2D view-specific extents and aligns multiple target grids to match a reference grid's length and bubble visibility.
  • Toggle Grid Head - Interactive click-to-cycle tool for grid bubble visibility (End0 only, End1 only, Both, Neither).
  • Grid Head Manager - Dialog-based tool for configuring bubble visibility on all grids by orientation (top/bottom for vertical, left/right for horizontal) with optional extension to crop boundaries.

Level Tools

  • Align - Picks a reference level and aligns target levels to match its horizontal extent in the current view.
  • Toggle - Interactive click-to-cycle tool for level bubble visibility between ends.
  • Manager - Dialog-based tool to set head visibility (left, right, both) for all levels and optionally extend to crop region or scope box boundaries.

Sheets

  • Copy - Captures viewport positions from the current sheet, auto-selecting if only one viewport exists or prompting when multiple are present.
  • Paste - Places previously copied viewport locations onto the current sheet using smart mapping logic that auto-aligns legends and handles non-legend viewports.
  • Refresh Viewport - Re-syncs a viewport's title line with its current extents by deleting and recreating the viewport while preserving position, rotation, pinned state, and styling.

Requirements

  • Autodesk Revit 2023 or later
  • pyRevit 4.8+

Installation

  1. Install pyRevit if you haven't already
  2. Clone or download this repository
  3. Rename the folder to pySC.extension (or keep the name and add the parent folder)
  4. In pyRevit, go to pyRevit tab > Settings > Custom Extension Directories
  5. Add the folder containing pySC.extension
  6. Reload pyRevit

Project Structure

pySC/
  lib/                           # Shared library modules
    __init__.py                  # Package initialization
    base.py                      # Core utilities, compatibility helpers
    circuits.py                  # Circuit management utilities
    common_utils.py              # Common utility functions
    conduits.py                  # Conduit run analysis
    data_collectors.py           # Element collection patterns
    device_helpers.py            # Selection filters for electrical devices
    electrical_calcs.py          # Voltage drop, conduit fill calculations
    grids.py                     # Grid state copy/paste utilities
    levels.py                    # Level datum helpers
    links.py                     # Linked model utilities
    nec_data.py                  # NEC Chapter 9 reference tables
    panels.py                    # Panel schedule helpers
    parameters.py                # Parameter read/write with caching
    phase_balance.py             # Panel phase load analysis
    sheets.py                    # Viewport copy/paste management
    spatial.py                   # Spatial indexing and clustering
    xaml_helpers.py              # Runtime XAML style loader
    StandardStyles.xaml          # Shared WPF UI styles
  pySC.tab/                      # pyRevit toolbar definition
    Annotation.panel/            # Tag, room, layout tools
    Datums.panel/                # Grid and level tools
    Electrical.panel/            # Circuit, panel, conduit, fire alarm tools
    Sheets.panel/                # Viewport copy/paste

Contributing

Contributions are welcome. If you'd like to fix a bug, improve a tool, or add something new:

  1. Fork the repo
  2. Create a feature branch
  3. Test in Revit with pyRevit before submitting
  4. Open a pull request with a clear description of the change

Please keep PRs focused - one fix or feature per PR.

Disclaimer

This extension is provided as-is under the MIT license. It was built for real production use but comes with no warranty or guaranteed support. Use at your own discretion - always test on a non-critical project first.

If you find it useful, a star helps others discover it.

License

MIT

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages