Forge Documentation
Integration Guides
ForgeCAD connects to every other Forge product through a common WebSocket event bus. These guides cover the setup and event contracts for each integration.
ForgeHub
ForgeHub is the central event bus. Connect to it with your API key and subscribe to the event types you need:
import forgecad as fc
hub = fc.ForgeHub(api_key="fsk_live_xxxx")
# Subscribe to design revision events
@hub.on("design.revision.published")
def on_revision(event):
print(f"New revision: {event['revision_id']} on doc {event['document_id']}")
hub.listen() # blocks; use hub.listen_async() in async contexts
Events published by ForgeCAD:
| Event | Payload fields | Description |
|---|---|---|
design.revision.published | document_id, revision_id, author, timestamp | A design revision was saved and published. |
design.parameter.changed | document_id, name, old_value, new_value | A named parameter was modified. |
design.export.completed | document_id, format, path | An export finished successfully. |
bom.updated | document_id, added[], removed[], changed[] | The bill of materials changed. |
cam.toolpath.ready | document_id, operation_id, nc_path | A CAM toolpath was generated and is ready for ForgeMachine. |
ForgeOps integration
ForgeCAD feeds design and BOM data into ForgeOps for quoting, cost analysis, and capacity planning.
# ForgeCAD pushes BOM data to ForgeOps automatically when a revision is published.
# To push manually:
import forgecad as fc
doc = fc.Document.open("my_assembly.sfc")
ops = fc.ForgeOps(api_key="fsk_live_xxxx")
# Push the current BOM as a new job quote input
ops.create_quote_input(
document_id=doc.id,
revision=doc.current_revision,
quantity=100,
due_date="2026-07-01"
)
The design.revision.published event on ForgeHub triggers an automatic BOM sync to ForgeOps. Manual pushes are useful for quoting scenarios where you want to price a revision before publishing it.
ForgeOps.create_quote_input method and the automated dispatch handler were implemented in Sprint 64. If you are running an older version, update to ForgeCAD 2.4+ and ForgeOps 1.8+.ForgeSchematics integration
ForgeSchematics maintains a live two-way link between your ECAD tool and ForgeCAD. The integration uses IDF as the exchange format when a native plugin isn't available, and a direct WebSocket bridge when it is.
IDF import (any ECAD tool):
import forgecad as fc
doc = fc.Document.open("enclosure.sfc")
# Import a PCB layout from IDF
pcb = doc.import_idf(
board_file="my_pcb.emn",
component_file="my_pcb.emp"
)
# Check for clearance violations
violations = doc.check_clearance(pcb, min_clearance=1.5) # mm
for v in violations:
print(f"Violation: {v.component} is {v.distance:.2f}mm from {v.face}")
Live sync (Altium, KiCad, Eagle): Install the ForgeSchematics plugin for your ECAD tool. Changes in the PCB layout are pushed to ForgeCAD in real time via ForgeHub event schematics.board.updated.
ForgeMachine integration
ForgeCAD delivers NC programs and toolpaths to ForgeMachine via ForgeHub. When a CAM operation is completed in ForgeCAD, ForgeMachine receives a cam.toolpath.ready event and can schedule the job immediately.
import forgecad as fc
doc = fc.Document.open("part.sfc")
# Generate a 3-axis milling toolpath
op = doc.cam.add_operation(
type="pocket",
feature="pocket_1",
tool="T01_10mm_endmill",
stepdown=2.0,
stepover=0.5
)
# Post-process for Haas UMC-750
nc_code = doc.cam.post_process(op, controller="haas_umc")
# Deliver to ForgeMachine (publishes cam.toolpath.ready to ForgeHub)
doc.cam.deliver_to_machine(op, machine_id="VMC-01")
ForgeProcure integration
When a design revision is published, ForgeProcure reads the updated BOM from ForgeHub and automatically reconciles it against current inventory. Parts below reorder threshold generate draft POs.
# No code required for automated BOM sync — it happens via ForgeHub.
# To manually trigger a procurement review for a specific BOM:
import forgecad as fc
doc = fc.Document.open("assembly.sfc")
procure = fc.ForgeProcure(api_key="fsk_live_xxxx")
result = procure.reconcile_bom(
document_id=doc.id,
revision=doc.current_revision,
quantity=50 # production run quantity
)
print(f"Parts to order: {len(result.shortfalls)}")
for item in result.shortfalls:
print(f" {item.part_number}: need {item.required}, have {item.available}")
Complete integration guides (including RPC examples, event schema references, and version compatibility tables) are in the ForgeCAD repository under forge_docs/integration_*.md.