sketchucation logo sketchucation
    • Login
    1. Home
    2. RabidCicada
    3. Posts
    ℹ️ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info
    R
    Offline
    • Profile
    • Following 0
    • Followers 0
    • Topics 1
    • Posts 14
    • Groups 1

    Posts

    Recent Best Controversial
    • RE: Interest in a Networking Sockets Workaround

      One last question....Did you figure out the method of ruby integration through some documentation? or did you simply poke around enough?

      I guess if you are already familiar with he inner working of Ruby at the object file level then you would already recognize some stuff you'd find in Sketchups directories.

      I was learning the sketchup API as a reason to learn Ruby >.<.

      Anyways...thanks a lot for the treasure trove of information you've just presented me...now to do something useful.

      posted in Developers' Forum
      R
      RabidCicada
    • RE: Interest in a Networking Sockets Workaround

      Thanks TBD.

      I just didn't pay close enough attention to your instructions...which clearly state what to do.

      posted in Developers' Forum
      R
      RabidCicada
    • RE: Interest in a Networking Sockets Workaround

      Oh...Wait a minute....

      I'm at work so I can't test this but.....

      Are you supposed to (For each and every piece of Ruby code you want to execute):
      (1)Put your code in normal RDE console
      (2)Execute SUB script via Toolbar->Macro->SUB

      I assumed that the bridge was a constant bridge and that you just execute it once....then input and "run" ruby code as normal in RDE.

      posted in Developers' Forum
      R
      RabidCicada
    • RE: Interest in a Networking Sockets Workaround

      Thanks for the pointer to Alexs stuff...I'll play with that also.

      posted in Developers' Forum
      R
      RabidCicada
    • RE: Interest in a Networking Sockets Workaround

      Should I separately install Ruby 1.8.6?

      posted in Developers' Forum
      R
      RabidCicada
    • RE: Interest in a Networking Sockets Workaround

      Thanks for the responses.

      I am SEVERELY unfamiliar with hacking up sketchup...FYI.

      Question:
      Does Sketchup have it's own local copy of Ruby 1.8.6 etc? Or are you saying that I must use that version if I am to successfuly drive sketchup externally?

      I run code through RDE by simply typing it into the main editing window and then selecting "run" from the menu. Is that not the right way?

      I've already registered the SUB script with RDE.
      I may not be "executing" ruby code the right way. I start Sketchup with the scripts and exe in the plugins directory. I believe bridge_load.rb runs because I get a messagebox notification I put in there on purpose (for the success case). Then I start RDE. I run SUB script via toolbar->macro->SUB (I get the error about only one instance being allowed). Then I type some code into the normal box in RDE. Then I hit "run" and I get the error.

      Am I supposed to do things differently?

      I would appreciate if you laid out an exact step by step example to successfully execute a "Hello World" in a messagebox from the RDE interface.

      posted in Developers' Forum
      R
      RabidCicada
    • RE: Interest in a Networking Sockets Workaround

      It seems that Sketchup is running the bridge_load script as I can get UI.messagebox statements that I put into it.

      I even get the "SketchUp Bridge already started", if I force RDE to run the macro via Macro->SUB. So it seems like something is getting executed.

      But when I go to use Sketchup.version in RDE I get C:/Users/RABIDC~1/AppData/Local/Temp/rb4126.tmp:1:in `<main>': uninitialized constant Object::Sketchup (NameError)
      Which makes me think it's not being recognized.

      I know I could have all sorts of configuration problems so let me know what you think. Ruby 192, windows 7, Sketchup 8.

      posted in Developers' Forum
      R
      RabidCicada
    • RE: Interest in a Networking Sockets Workaround

      Hey Dan,
      Tried to load it up...Don't know how to get it to work.

      Running latest free Sketchup version and installed RDE etc. I think I execute the script correctly via your isntructions (copied all files into plugin dir, start sketch, start RDE, register Script, run code)but nothing valueable happens. I hit "run" after I type Sketchup.version into RDE....nothing useful, just error. Could use a little help if you really are up for getting your Ruby Bridge out there.

      I'm using Sketchup 8 on Windows 7.

      Your example ruby code for the Dictspy.rb doesn't do any good without the bridge part.

      My Bridge was specifically networking...but if you get the whole shebang then I can just build ontop. Failing any further input from you I can keep working on my own interface which would be just the networking sockets.

      posted in Developers' Forum
      R
      RabidCicada
    • RE: Interest in a Networking Sockets Workaround

      @richmorin said:

      Just wanted to note my interest in this effort. I'd love to have a reliable way to send and receive data on sockets.

      However, I'm curious why you're writing the server in C++. Is there some reason why it couldn't be written in Ruby?

      Sorry I never answered this. I believe you've probably figured it out by now but Sketchup doesn't support sockets. Not in an official sense and not very well even in the hacked up unofficial sense:)...or at least...last time I looked (long time ago)

      posted in Developers' Forum
      R
      RabidCicada
    • RE: Interest in a Networking Sockets Workaround

      Thanks guys. I appreciate the help you are willing to give:).
      My motivation for doing this network bridge was because I wanted to pursue a larger project that required network comms.

      I just recently became interested in actually doing that original project again so I think I will pick this up and run with it 😄

      posted in Developers' Forum
      R
      RabidCicada
    • RE: Interest in a Networking Sockets Workaround

      Wow....I forgot all about this.

      I'll check out your bridge. Looks like you probably tooka the same route I did. I had a successfulbridge built for quite some time....just never finished flushing out the command set.

      The client of the bridge wont have a problem sitting in an infinite loop. I handle that in the bridge.....and last I checked the google API supported threads...so that wouldn't be an issue.

      Any other concerns to be aware of TBD?

      posted in Developers' Forum
      R
      RabidCicada
    • RE: Interest in a Networking Sockets Workaround

      It would be event driven. You'll have to set up your own structure on your side for mapping the socket_id to whatever handler you want to handle it.

      On the sketchup side you would sit in an infinite loop reading from the named_pipe_file and then parse and handle everything that comes through.

      Given the example I provided above of it you would have to read in then parse SOCKET_ID EVT_ID DATADATADATA.

      I'll work on it some more in the coming couple weeks. It's not that difficult at all...I just don't have lots of time.

      posted in Developers' Forum
      R
      RabidCicada
    • RE: A Welcome Message to New SketchUcation Members

      Heyo...whats the lag time in posting? I posted int he developers forum about a networking sockets workaround and my post either vanished into thin air or it's waiting approval by a mod...or it was deleted. Is this board moderated?

      posted in Newbie Forum
      R
      RabidCicada
    • Interest in a Networking Sockets Workaround

      Hey all,
      I just got a networking socket workaround in prototype state. I have an external C++ program open a namedPipe and have sketchups ruby API open it as a normal file.

      So I have a workable method for passing data back and forth. I was planning on using it strictly for my own goals meaning I don't need generic socket control...but if people are interested enough I would be willing to put work into a SIMPLE generic socket interface and of course I would open source the C++ bridge.

      --Interaction and details are below--
      IE.
      C++ program opens namedPipe "\.\pipe\networkBridge" and waits for commands.
      Sketchup Ruby API opens file "\.\pipe\networkBridge" and sends commands

      Commands are something like:
      TCPOpen SOCKET_ID 192.168.1.27 8000
      TCPSend SOCKET_ID DATADATADATA
      UDPSend 192.168.1.27 9000 DATADATADATA

      The Bridge will automatically write any information from the sockets to the named pipe and the Ruby program must suck it in like drinking from a firehose. There will be a format for incoming data so the ruby program can tell what event happened on which socket.

      Something like:
      SOCKET_ID EVT_ID EVENT_DATA

      posted in Developers' Forum
      R
      RabidCicada
    • 1 / 1