Sketchup::model#import : Force "Use Image As" Image
-
Hi everyone,
I'm trying to make a tool to import an image of my choice (not the user's), but keeping functionalities of the standard tool (placing & scaling with preview), that's why I use Sketchup::model#import and not Sketchup::Entities#add_image.
But, when I do like that, I'm depending on the last choice of Use image as the user's made in import dialog. I didn't find any ImporterOption to control it, or something else.
Any idea how to control it ? Or should I make a full tool and use add_image ?
Thanks
-
@alexms said:
But, when I do like that, I'm depending on the last choice of Use image as the user's made in import dialog.
You are correct there are no importer options for image file types exposed in the Ruby API.
If you are still using SU2017 Make, then there is no way to change what the user's last setting was, whilst SketchUp is running. It is saved in the registry, and although SketchUp will immediately update the user's setting (if it changes,) SketchUp core will still use it's internal memory of the setting instead of checking the registry.
This means if you attempt to tweak the registry whilst SketchUp is open, it will have no effect.@alexms said:
Or should I make a full tool and use add_image ?
This is likely your only option. I did post an example of dragging objects around within a tool at the SketchUp forums ... See links in this post:
https://forums.sketchup.com/t/how-to-realize-the-drag-effect/125758/4Once the image is placed, you might try to push it's reference into the selection set alone and activate the ScaleTool.
Sketchup.send_action("selectScaleTool:")
Advertisement