forked from 1b-agent/opencadstudio-upstream
Automation: ribbon tab and dropdown actions; _PDFIMPORTFILE takes a path
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
28853cd32e
commit
c9426a5d6d
3 files changed
+38
No files matched your search
@@ -669,6 +669,17 @@ impl OpenCADStudio {
|
||||
"_PDFIMPORTFILE" => {
|
||||
return Some(Task::done(Message::PdfImportPick));
|
||||
}
|
||||
// A file named after it skips the picker.
|
||||
cmd if cmd.starts_with("_PDFIMPORTFILE ") => {
|
||||
let path = cmd["_PDFIMPORTFILE ".len()..].trim().trim_matches('"').to_string();
|
||||
match std::fs::read(&path) {
|
||||
Ok(bytes) => {
|
||||
crate::scene::model::pdf_raster::register_source(&path, std::sync::Arc::new(bytes));
|
||||
self.open_pdf_import_file(&path);
|
||||
}
|
||||
Err(_) => self.command_line.push_error(&format!("{path} not found.")),
|
||||
}
|
||||
}
|
||||
"PDFCLIP" | "CLIP" => {
|
||||
use crate::command::CadCommand;
|
||||
let command = crate::modules::insert::pdf_clip::PdfClipCommand::new(cmd == "CLIP");
|
||||
|
||||
Reference in new issue
Block a user