Hi all

I have one requirement in sketchup 8

When i am importing an image in sketchup 8, it ask me to choose 2 points for placing and scaling the image.

My requirement is after choosing an image for importing into model, i need to put it at default position instead of asking user choose picking points.

How can i do it in sketchup API ?

Thanks for your helping.

有帮助吗?

解决方案

Use Entities.add_image: http://www.sketchup.com/intl/en/developer/docs/ourdoc/entities.php#add_image

The second argument dictates where it should be positioned. If you need to rotate it, transform it afterwards.

model = Sketchup.active_model
entities = model.active_entities
point = Geom::Point3d.new(10, 20, 30)
image = entities.add_image("Shapes.jpg", point, 300)
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top