# Electron app extension

**URL:** <https://forums.sketchup.com/t/electron-app-extension/226577>\
**Category:** Ruby API\
**Created:** [April 10, 2023, 10:11am UTC](https://forums.sketchup.com/t/electron-app-extension/226577 "2023-04-10T10:11:04Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![peraita10](https://avatars.discourse-cdn.com/v4/letter/p/f475e1/32.png) [@peraita10](https://forums.sketchup.com/u/peraita10)\
**Post date:** [April 10, 2023, 10:11am UTC](https://forums.sketchup.com/t/electron-app-extension/226577/1 "2023-04-10T10:11:04Z")

</div>

Im having some problems to connect my electron app to the sketchup extension through an IPC. Any leads on how to do that?  
Thanks!

---

<div class="post-metadata">

**Author:** ![dezmo](https://sea2.discourse-cdn.com/sketchup/user_avatar/forums.sketchup.com/dezmo/32/51058_2.png) [@dezmo](https://forums.sketchup.com/u/dezmo)\
**Post date:** [April 10, 2023, 10:40am UTC](https://forums.sketchup.com/t/electron-app-extension/226577/2 "2023-04-10T10:40:33Z")

</div>

I moved your topic to Developers category, perhaps you will get better advise here…

I have no idea about your question, but sure the SketchUp Free (web) - as you stated in your profile - does not allow to use any extension. Anyway, the web app is version-less (always actual), and I don’t know any person who have such an operating system and graphic card that you have.

---

<div class="post-metadata">

**Author:** ![francisquitof](https://sea2.discourse-cdn.com/sketchup/user_avatar/forums.sketchup.com/francisquitof/32/191263_2.png) [@francisquitof](https://forums.sketchup.com/u/francisquitof)\
**Post date:** [April 10, 2023, 12:17pm UTC](https://forums.sketchup.com/t/electron-app-extension/226577/3 "2023-04-10T12:17:15Z")

</div>

Sketchup web doesn’t allows to install extensions, only in the pro and studio version you can do it, also your profile information must be corrected, 2022 isn’t an operative system and Mac isn’t a graphics card.

---

<div class="post-metadata">

**Author:** ![dezmo](https://sea2.discourse-cdn.com/sketchup/user_avatar/forums.sketchup.com/dezmo/32/51058_2.png) [@dezmo](https://forums.sketchup.com/u/dezmo)\
**Post date:** [April 10, 2023, 1:55pm UTC](https://forums.sketchup.com/t/electron-app-extension/226577/4 "2023-04-10T13:55:42Z")

</div>

@francisquitof, thanks for the “translation”… I’m always happy when someone interprets it correctly. 😜 🍻

---

<div class="post-metadata">

**Author:** ![peraita10](https://avatars.discourse-cdn.com/v4/letter/p/f475e1/32.png) [@peraita10](https://forums.sketchup.com/u/peraita10)\
**Post date:** [April 10, 2023, 3:42pm UTC](https://forums.sketchup.com/t/electron-app-extension/226577/5 "2023-04-10T15:42:14Z")

</div>

Im using Sketchup pro, and both the extension and the electron app are already created, but I need to connect them using named pipes, and my problem is I dont know how to call the named pipes referred in the typescript electron app from the ruby extension script.

---

<div class="post-metadata">

**Author:** ![dezmo](https://sea2.discourse-cdn.com/sketchup/user_avatar/forums.sketchup.com/dezmo/32/51058_2.png) [@dezmo](https://forums.sketchup.com/u/dezmo)\
**Post date:** [April 10, 2023, 4:21pm UTC](https://forums.sketchup.com/t/electron-app-extension/226577/6 "2023-04-10T16:21:13Z")

</div>

> [@peraita10](#):
>
> ruby extension script

Thanks for clarifying, and updating your profile. 👍 Now I moved again your topic to Ruby API category, which seems more relevant.

* * *

( Again, I don’t now about “typescript electron app” but if it is similar than JavaScript that can be an idea to use [JavaScript Object Notation (JSON)](https://ruby-doc.org/stdlib-2.7.2/libdoc/json/rdoc/JSON.html#module-JSON-label-Extended+rendering+and+loading+of+Ruby+objects) for data interchange. )

---

<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:** [April 10, 2023, 4:50pm UTC](https://forums.sketchup.com/t/electron-app-extension/226577/7 "2023-04-10T16:50:35Z")

</div>

Pipes do work well on MacOS, but **not** well on Windows platform because of the way that SketchUp “steals” standard IO for it’s own Ruby Console.

If you are only going to run your extension and app on Mac, then look at:

- [`IO::popen`](https://ruby-doc.org/core-2.7.2/IO.html#method-c-popen) core Ruby method

- [`Open3`](https://ruby-doc.org/stdlib-2.7.2/libdoc/open3/rdoc/Open3.html) standard library with class methods:

* * *

If you also need to run on Windows platform you will need an alternative. Sockets, a local server, or write output to a file and have SketchUp Ruby read the file.

See previous discussion on pipes and IO from external processes:

- [Launching subprocess in Ruby plugin - Not entering IF statement when loading from SketchUp](https://forums.sketchup.com/t/launching-subprocess-in-ruby-plugin-not-entering-if-statement-when-loading-from-sketchup/97380)

- [Defining callbacks to receive external commands?](https://forums.sketchup.com/t/defining-callbacks-to-receive-external-commands/28413)

---

<div class="post-metadata">

**Author:** ![MSP\_Greg](https://sea2.discourse-cdn.com/sketchup/user_avatar/forums.sketchup.com/msp_greg/32/206066_2.png) [@MSP\_Greg](https://forums.sketchup.com/u/MSP_Greg)\
**Post date:** [April 14, 2023, 2:45pm UTC](https://forums.sketchup.com/t/electron-app-extension/226577/8 "2023-04-14T14:45:03Z")

</div>

> [@peraita10](#):
>
> how to call the named pipes referred in the typescript electron app from the ruby extension script.

Never used named pipes with Ruby, on any platform. I’ve used various sockets with SketchUp, but not named pipes.

Re Windows and named pipes, see:

> **[GitHub - chef-boneyard/win32-pipe: A Ruby interface for named pipes on MS...](https://github.com/chef-boneyard/win32-pipe)**
>
> A Ruby interface for named pipes on MS Windows. Contribute to chef-boneyard/win32-pipe development by creating an account on GitHub.

I haven’t used it.

I’ve wonder it before; should SketchUp include the ffi gem in its Ruby files?
