Ruby API model.importToPoint

Hello!

I have been trying to import multiple SKP files in my script to known points. The current model.import requires the user t click a point.

A method to import to a point would be useful… (to me any hoo)

something like:

model.importToPoint '*.skp' (100,200,300)

see this post

Ed

Try loading the SKP as a new component definition [rather than importing it] - referenced as thus:
that_definition = Sketchup.active_model.definitions.load(path_to_the_skp)
Look at the API docs for more details…
Now decide on its location:
some_transformation = Geom::Transformation.new(some_chosen_point3d)
Them use:
instance = Sketchup.active_model.active_entities.add_instance(that_definition, some_transformation)

Bish-bash-bosh:smiley:

2 Likes

I show the same workflow followed by explode and purging the definition list.:
http://forums.sketchup.com/t/how-to-import-skp-to-a-3dpoint-why-is-it-stuck-on-my-mouse/18746/4

Is there an equivalent way that will also work for non-.skp files? Say, .3ds or .dae models?