catia 0.1.1

Rust COM bindings and helpers for CATIA V5
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use catia::{ComApartment, CatiaApp, com_get};
use catia::variant::variant_to_i32;
use windows::core::Result as WinResult;

fn main() -> WinResult<()> {
    let _apartment = ComApartment::init_sta()?;
    let app = CatiaApp::new()?;
    let docs = app.documents()?;
    let v = com_get!(docs, "Count")?;
    if let Ok(Some(count)) = variant_to_i32(&v) {
        println!("Documents.Count = {}", count);
    }
    Ok(())
}