# I am trying to figure out how to place a component with a button press

**URL:** <https://forums.sketchup.com/t/i-am-trying-to-figure-out-how-to-place-a-component-with-a-button-press/43326>\
**Category:** Ruby API\
**Tags:** components\
**Created:** [April 21, 2017, 1:27am UTC](https://forums.sketchup.com/t/i-am-trying-to-figure-out-how-to-place-a-component-with-a-button-press/43326 "2017-04-21T01:27:53Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![DanRathbun](https://sea2.discourse-cdn.com/sketchup/user_avatar/forums.sketchup.com/danrathbun/32/500_2.png) [@DanRathbun](https://forums.sketchup.com/u/DanRathbun)\
**Post date:** [June 18, 2017, 9:37pm UTC](https://forums.sketchup.com/t/i-am-trying-to-figure-out-how-to-place-a-component-with-a-button-press/43326/4 "2017-06-18T21:37:16Z")

</div>

By the way, I had written a couple of examples here previously:

> [@How to import SKP to a 3dpoint? Why is it stuck on my mouse?](https://forums.sketchup.com/t/how-to-import-skp-to-a-3dpoint-why-is-it-stuck-on-my-mouse/18746/4):
>
> We already have a preferred way to do this: skp = UI.openpanel("Import Model","","SketchUp Model (SKP)|\*.skp||")) return if skp.nil? # user cancelled mod = Sketchup::active\_model cdef = mod.definitions.load(skp) return unless cdef # good practice # could be "next unless cdef" inside a loop point = Geom::Point3d::new( 10, 10, 0 ) # loaded from external file cinst = mod.active\_entities.add\_instance( cdef, Geom::Transformation::new( point ) ) If no errors occur, the instance can be exploded…

> [@\[Example\] Import a 3DS using a specific transform (Cross-Platform)](https://forums.sketchup.com/t/example-import-a-3ds-using-a-specific-transform-cross-platform/23425):
>
> Continuing the discussion from [Ruby API model.importToPoint](http://forums.sketchup.com/t/ruby-api-model-importtopoint/18747/4): Here is my example. It should now be cross-platform. I found a reference to a cancel action string at the Apple Developer website. Here is v 2.0.0: [import\_3ds\_to\_point\_cross\_platfrom.rb](https://forums.sketchup.com/uploads/short-url/cXYiYcTSfpCVgqwbVOySmaCOQzr.rb) (2.5 KB) NOTE: The imported definition will have triangulated faces.(You’ll need to deal with that issue separately.) # encoding: UTF-8 # # Example of importing a 3ds file to a specific transformation. # # by Dan Rathbun, v 2.0.0, made cross-platf…

---

_[View the full topic](https://forums.sketchup.com/t/i-am-trying-to-figure-out-how-to-place-a-component-with-a-button-press/43326)._
