I am new to Ruby and Sketchup API.
I am searching how to import and apply a transformation to a PNG image.
I want to automate the same behaviour than when you use import a PNG from the file menu, set the origin and set the width of the image, but automatically with the API.
I did experiments the model.import:
model = Sketchup.active_model
status = model.import(“/private/tmp/background.jpg”, false)
The image is imported, but stick to the mouse pointer and I have still to click and put the scale from mouse.
How could I also set the origin and width from the API only ?
As a bonus, I would like to download the png from a URL and not anymore from a file.png.
I wouldn’t necessarily agree on this point. You always need to start somewhere and it can just as well be making plugins/scripts for SketchUp as anything else. Having a practical goal can be very motivating when learning something new.
This is my opinion, I’ve stated it manys times. There is nothing that will ever make me feel any different.
Again and again, over and over I see newbies struggle needlessly, when they’d not do so if they had done like I, and read the “PickAxe” book cover to cover before even attempting any SketchUp programming.