sketchucation logo sketchucation
    • Login
    1. Home
    2. Ellipser
    3. Posts
    โ„น๏ธ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info
    E
    Offline
    • Profile
    • Following 0
    • Followers 0
    • Topics 4
    • Posts 14
    • Groups 1

    Posts

    Recent Best Controversial
    • RE: How do I get Mathn.rb to work?

      @tt_su said:

      Are you just doing computations? Or are you generating geometry?
      For computations adding more Ruby code (ie another Ruby library) won't speed things up. I've had to resort to writing Ruby C Extensions to do calculations fast. For just doing math C/C++ isn't that scary. We got examples of projects in Visual Studio and Xcode on GitHub that have everything set up to toy around.
      If it's generating geometry there might be ways to get better performance - bulk operations etc.

      Do you have some code to look at - that way we would know exactly what we're dealing with here?

      I'm generating geometry on this plugin:http://sketchucation.com/forums/viewtopic.php?f=323%26amp;t=57790

      I took a class in C++, so I can do that, and have done a significant amount of C++ for embedded microcontrollers.

      I'd like to learn how to interface C++ with Sketchup, so I can speed things up. Basically my problem is that I need a road-map of sorts to get there.
      First thing is, what C++ compiler should I use? Visual Studio? I don't want to pay Bill Gates $500 for just hobbyist work that I'm doing. I used DevC++ before. I'm not at all familiar with Xcode, so I guess I'll Google that after I'm done writing this post.

      I've seen the SDK code on the Trimble site, but, what next? Step 1 would be of course to download a C++ compiler. Then what? Where do I put all the header files? Could you recommend a tutorial if there is one?

      Ultimately, I'm going to interface Sketchup with my 3D printer, which is in the final stages of being made. (It already does plotting when provided G-code). Next step is mounting the extrusion head and generating G-code from a Sketchup file. Also, with just using the Dremel mount I have, I can do milling. I want to do some Celtic designs created in Sketchup and then milled into wood.

      Thanks for you time, btw.

      posted in Developers' Forum
      E
      Ellipser
    • RE: How do I get Mathn.rb to work?

      @tt_su said:

      @ellipser said:

      Thanks. I'm going to upgrade to 2014. I'm using it for its complex numbers functions. That spirograph plugin I made crashes the system with relatively simple designs, and I am going to re-do it using complex numbers with the hope that it uses less system resources and averts a crash.

      Right, I doubt you crash for the reasons you think. If that's your motivation to use it then I don't really think it'll pay off.
      When you crash, you get a BugSplat dialog, right? Did you submit these? Did you enter any info in them that we can look up? We might be able to help you pin-point the source of your crash and find a workaround with less guessing.

      I guess I'm not using the right terminology. It really doesn't crash, it just takes a long time to process, so long that I resort to a ctrl-alt-delete after about 5 minutes of waiting. I guess part of this is that I'm using a slow computer. Sometimes when I use that plugin, it says, "Sketchup is not responding" but if I wait long enough, it eventually completes the process.

      So, really there is no crash, just that I'm using a slow computer. I never really thought that a crash is different than a process that takes too long and you get a Microsoft-level error message.

      posted in Developers' Forum
      E
      Ellipser
    • RE: How do I get Mathn.rb to work?

      Thanks. I'm going to upgrade to 2014. I'm using it for its complex numbers functions. That spirograph plugin I made crashes the system with relatively simple designs, and I am going to re-do it using complex numbers with the hope that it uses less system resources and averts a crash.

      I'll post the plugin when I'm done with it.

      Thanks for all the info too. Some of those questions were just wondering out loud.

      When I really get good at Sketchup Ruby, I'll be able to make all the designs in the little booklet that comes with the kit. It's some really cool symmetry I think.


      Sprirograph in 4 way.jpg

      posted in Developers' Forum
      E
      Ellipser
    • How do I get Mathn.rb to work?

      I'm trying to simplify my code by using Mathn, this is of course a ruby program that is an add-on. It works when I'm just using straight Ruby by itself, not involving Sketchup at all. (I can tell that Sketchup is using a different version of Ruby, when I do a query).

      When I use Mathn on Sketchup's Ruby, it doesn't work. Why is that? What do I need to do to get Mathn to work? Is there some additional plugin I need to put somewhere? Is there some "require" line of code I need to use? Can I have my code somehow use the "external" ruby software that I have outside of Sketchup and I play with using Notepad++? But, if I do this, it would make my plugin program a lot more complicated if someone else wants to use it.

      Anyway, if someone out there knows how to use "Mathn" in a plugin, please inform. TYIA.

      And, btw, I went looking in the Sketchup file to see where it keeps a copy of Ruby. I couldn't find it, so perhaps it's deeply embedded in the code and non-accessible? Just out of curiosity, does anyone know where Sketchup keeps the Ruby interpreter?

      posted in Developers' Forum
      E
      Ellipser
    • RE: [Plugin] 2.5D CAM Plugin 20121202

      Thanks for making this file. It worked for me first time.

      posted in Plugins
      E
      Ellipser
    • RE: My First Plugin: Spirograph

      For people just getting started with plug-ins, here's how you use one:

      1. Download the plug-in attached to the thread's first post.

      2. Click/drag it onto your desktop.

      3. Open any folder, and go look for where Sketchup's plugin file is kept on your computer. On mine it's in C:\Program Files (x86)\SketchUp\SketchUp 2013\Plugins
        This is also called a "path" in computer lingo.

      Your path should be something similar. This is where you get to add features to your copy of Sketchup.

      1. Drop the Spirograph.rb file from step 2 into that folder. You have to re-start Sketchup to use it, because Sketchup only loads plugins at start-up.

      2. You should see a Plugin called "Spirograph". Try some settings like:

      16
      8
      7
      20

      and have fun.

      You can easily crash your system if you over-burden it with too many segments. Every curve can be reduced to line-segments, and "segments" is the setting you change to get a smoother effect. Too much smoothing will result in a system crash. It's sort of like that sandbox tool. It doesn't take too much to crash the system if you have an average-speed computer like mine. (For you pros using a graphics card of something, that probably doesn't apply.)

      20 is a good number for reasonable smoothness for segments.

      Anything above about 30 for the fixed radius is a bit much too. You don't end up with a nice design anyway, but a dense mat of lines/edges.

      At some point it may be possible to use some C++ code to do the heavy multiplications internally done in the plugin to reduce crashes, but for now, I'm using the convenience of Ruby at the expense of system resources.

      Pretty cool, huh? Takes you back to when you were a wee-lad and using those sharp-pins that held down the fixed radius. They wouldn't allow any sharp edges in any toy today, now would they?

      posted in Plugins
      E
      Ellipser
    • RE: My First Plugin: Spirograph

      The plugin is still in beta. I guess you guys are the beta testers and didn't know it ๐Ÿ˜„ .

      Unfortunately, large settings crash your system. I'll have to put in some sort of limit to what you can put in. I tried to get around the problem by making one curving segment, and then using a rotation matrix to just rotate the segment to save memory, but that hogs up as much memory as just doing the design in one fell-swoop.

      Also, I'm using groups, but what I should be doing is using edges. This way it will be easier to add colors using the paint brush. For the examples below, I cheated ๐Ÿ˜ณ by PrintScreen and then adding colors in Paint.

      For now, look at the pretty colors. Someone out there might want to use it for a kid's room or something playful.


      Sprirograph examples.jpg

      posted in Plugins
      E
      Ellipser
    • My First Plugin: Spirograph

      There is a certain condition when it makes a double line. That needs to be corrected, but for now, this is just something to play with.


      Spirograph.rb

      posted in Plugins
      E
      Ellipser
    • RE: Rule no.1 in Sketchup for 3d printing

      I thought rule number one is to make sure you are using volume objects, not just surfaces. If you have a cube with just one face missing, the software will think it's just infinitely thin surfaces and print nothing.

      I'm just getting started with 3d printing, so I may be wrong.

      posted in SketchUp for 3D Printing
      E
      Ellipser
    • RE: Getting Started with Sketchup's SDK

      @icehuli said:

      Hi Ellipser,

      You can do so, but it is not easy.
      Currently, as tt_su said, there is no real time inter-program API of SketchUp.
      What you can do is:
      Create a C or C++ extension, lets call it ApiBridge, and load ApiBridge in a ruby file that loaded by SketchUp.
      In ApiBridge you need to

      1. implement a C/C++ API wrapper to the Ruby API your self,
      2. maintain a communication to another program within a new thread.
        Then you can do real time interaction with SketchUp through the ApiBridge.
        For example, you can send/receive message/data to/from ApiBridge to do/get stuff to/from the SketchUp model.

      Thanks for your reply. If I understand this right, a C++ extension is something that would go inside a Ruby file. I guess I'd have to look up the syntax for writing a C++ file that goes inside a Ruby file.

      Then, well, would you be so kind as to explain what an API wrapper is? API means "Application Programming Interface", so I'm guessing a wrapper would be the method that you use to grab data from another file?

      This is going to take a while for me. I'm going to have to become an expert Ruby user first if you call this not easy and you are experienced.

      Isn't there some way to "cheat"? I mean the command line is already there in Ruby console, all I'd have to do is find someway of accessing that command line from an external program. I'm wondering if there is some sort of command-line prompt that could be used.

      posted in Developers' Forum
      E
      Ellipser
    • RE: Getting Started with Sketchup's SDK

      @tt_su said:

      The C API only let you read and write SKP files at this time. It doesn't let you interact with the live model.

      Only the Ruby API interacts with the live model. What you could do is create a Ruby C Extension - and use that to bridge the communication between your application and the SketchUp Ruby API.

      We are about to release a GitHub project with a Hello World example of a Ruby C++ Extension. Though it's not fully complete yet. You can keep an eye on our GitHub account: https://github.com/SketchUp/

      Can you elaborate on what kind of tasks you're planning on performing with this?

      Thomas Thomassen from Trondheim...

      What I want to do is have some real-time feedback from a CNC machine so the user can see the path of a tool-cutter. Also, I want to convert Sketchup data into a tool path and create a file which gets sent to the machine.

      Yeah, I know there is a lot of CNC software out there, but it costs $4,000 a copy sometimes. The cheap stuff wouldn't give me 100% control, as you are confined to straight lines, holes, etc.

      Also, it would be kind of fun, as it would open the doors to a lot of hobbyists that want some easy-to-make visuals that represent things in the real world. I know a lot of users of SU do it for architectural purposes, but this would be for visual representation of the real-world. Like, say you have a greenhouse, and you want a screen on your computer to show temperature data. With a real-time plugin, you would be able to have a visual representations of the various thermocouples spread out inside the greenhouse.

      Yes, I know there is software out there that does this not in Sketchup, (Wonderware for example), but it costs thousands of dollars a copy. That's not going to be any good for a guy that just wants to keep track of his greenhouse temps.

      I'm not 100% partial to C++, I've been delving into Ruby programming just now. If using straight Ruby is easier, then I'm going to go that route.

      I guess I'm looking for a tutorial on the basics of how to get a Ruby API to do a real-time interaction with Sketchup. Or, maybe just an outline of what I need to do. Which one of the API instructions can be used to send instructions to Sketchup?

      Maybe I'm not asking the right question. Basically, let's say you have a program running in Ruby, and it is getting position data from a CNC machine constantly updated. How would you display that data on Sketchup in real-time?

      Thanks for your help.

      posted in Developers' Forum
      E
      Ellipser
    • RE: Getting Started with Sketchup's SDK

      @jim said:

      Still not sure what you want to do. You use the Ruby API to interact with a model which is open in SketchUp. You would use the SDK to interact with a .skp file on disc.

      What if I want an outside program controlling an open Sketchup model in real time? How do I go about it?

      I understand I'd use some of the code in the SDK website, but what else do I need?
      Which compiler?
      Where does the compiled C++ file go?
      Which .dll files do I need?

      Basically I'm looking for a simple outline of what's needed to get a Sketchup model modified in real time from an outside program. Not a plugin, but an independent program doing the controlling. It would be an .exe.

      I'm more familiar with C++ than Ruby, but I could use it too.

      Let me ask you this: How would you go about having an outside program control a Sketchup model, while the model is open?

      I'm looking for something a bit more detailed than saying, "use the Ruby API". Thanks in advanced for any help.

      posted in Developers' Forum
      E
      Ellipser
    • Getting Started with Sketchup's SDK

      Hello,

      What I want to do is to get started with the C++ part of Sketchup. Basically I'm trying to interact with a Sketchup drawing using an external program.

      Sketchup has the console feature, which is pretty close to what I want to do, but not exactly. I would like to be able to send lines of code to that Console feature in real-time.

      I took a look at the page http://www.sketchup.com/intl/en/developer/su-api/index.html and it gives a few examples of C++ code, which I'm familiar with in a classroom setting.

      But, what I'm looking for is a bit of advice on how to get started.

      In order to use the SDK, I need some sort of compiler, but where do I put all the include files? What compiler is acceptable? Do I have to use a Microsoft's Visual Studio?

      Basically what I'm asking the forum is for an outline of how to get started. Download Sketchup... get a copy of software "x"... put include files in location "X"...

      Let's say I just want to send a set of data to create an edge in Sketchup from a DOS command line, what should the command line read so that I'm in the right place to do it? By this I mean you wouldn't have it say C:>notepad, or something like that. What should it read?

      Any help would be appreciated.

      posted in Developers' Forum
      E
      Ellipser
    • Real-time Interactive Rendering

      Hi, this is my first post, so I should just say "Hi" before asking the forum a question.

      Let's say I want to send lines of code to Sketchup in real time
      from a separate C++ program. Like, let's say I have a CNC machine and I want
      Sketchup to constantly update the screen with new graphics which would indicate
      where a cutting tool is located. How would I do this?

      I would need some way of sending real-time data to Sketchup.

      Already there is the Ruby console on Sketchup. It allows me to type in lines
      of code which get converted into an image on Sketchup. Now, basically I want to take this a step further, and have a separate program do it in real time.

      This could be used for a bunch of different reasons. I could interface Sketchup with a
      microcontroller input, and say have a mock-up of a car's speedometer. From a potentiometer input, I'd like to adjust what the speedometer reads on the screen in real-time.

      Or, maybe I want to create a video-game in which inputs from a controller allow you to
      walk through a neighborhood.

      How would I go about this? This might be something kind of fun. Basically, is there some method by which you can feed ruby scripts to Sketchup from a separately running program?

      posted in SketchUp Feature Requests sketchup
      E
      Ellipser
    • 1 / 1