catia 0.1.1

Rust COM bindings and helpers for CATIA V5
Documentation
  • Coverage
  • 1.45%
    1 out of 69 items documented0 out of 63 items with examples
  • Size
  • Source code size: 87.9 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 794.9 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 17s Average build duration of successful builds.
  • all releases: 20s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • Documentation
  • Repository
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • luzhihaoTestingLab

catia

Rust COM bindings and helpers for CATIA V5 on Windows.

Features

  • COM bootstrap helpers (ComApartment) for safe COM initialization.
  • High-level CatiaApp wrapper around CATIA V5 COM automation.
  • CatiaApi trait with mock and real implementations for testing.
  • Examples covering documents, selection, export, and dialogs.

Requirements

  • Windows only (windows crate, Win32 COM APIs).
  • For real automation: CATIA V5 installed and registered ProgID (e.g. CATIA.Application).
  • For unit/demo: use --mock to run examples without CATIA.

Quick Start

Add to Cargo.toml:

[dependencies]
catia = "0.1.1"

Create an app and call APIs:

use catia::{ComApartment, CatiaApp};
use catia::catia::{CatiaApi, CatiaMock};

fn main() -> windows::core::Result<()> {
    let _apt = ComApartment::new()?;
    // Use real CATIA if ProgID is registered, otherwise mock
    let app: Box<dyn CatiaApi> = if catia::com::is_progid_registered("CATIA.Application")? {
        Box::new(CatiaApp::new("CATIA.Application")?)
    } else {
        Box::new(CatiaMock)
    };

    println!("CATIA visible? {}", app.visible()?);
    Ok(())
}

Run examples:

cargo run --example selection_search -- --mock --query "CATGmoSearch.Point,all"
cargo run --example export_document -- --mock --path "C:/Temp/Export.stp" --fmt stp

Notes

  • COM calls mirror CATIA V5 automation (Documents, Selection, ActiveDocument, etc.).
  • Mock mode prints simulated COM calls for local testing.
  • Export options may vary by document type; adapt as needed.

License

MIT. See LICENSE.txt.