| Crates.io | catia |
| lib.rs | catia |
| version | 0.1.1 |
| created_at | 2025-10-14 03:59:24.737443+00 |
| updated_at | 2025-10-14 06:12:45.334234+00 |
| description | Rust COM bindings and helpers for CATIA V5 |
| homepage | https://gitee.com/luzhihaoTestingLab/rscatia |
| repository | https://gitee.com/luzhihaoTestingLab/rscatia.git |
| max_upload_size | |
| id | 1881627 |
| size | 87,899 |
Rust COM bindings and helpers for CATIA V5 on Windows.
ComApartment) for safe COM initialization.CatiaApp wrapper around CATIA V5 COM automation.CatiaApi trait with mock and real implementations for testing.windows crate, Win32 COM APIs).ProgID (e.g. CATIA.Application).--mock to run examples without CATIA.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
MIT. See LICENSE.txt.