Code Profiling
-
@thomthom said:
I's always thought that the SketchUp C++ SDK was only allowing other application to read/write .skp files.
Me too, but maybe you can save the file, run your code, and reload the file? Does it work like that?
-
@unknownuser said:
Which is refered to as beta and out of date...
yeah, that's the one. there is also the Sketchup.active_model.skpdoc that gives you a bridge to SDK world - it gives back the pointer to the Sketchup document interface. funny thing that it was available in SU5, removed in SU6 (least in 6.0.515 it was not available) and now is back
the problem is with not supported thing that worries me - what if it will be removed, again, from next version ?
but, as Adam said, it is a big boost in speed and reliability and I think you can create a fallback version in Ruby, just in case
also there are a lot more tools for profiling in C++ world than in Ruby.
-
@unknownuser said:
yeah, that's the one. there is also the Sketchup.active_model.skpdoc that gives you a bridge to SDK world - it gives back the pointer to the Sketchup document interface.
That let you use the SDK on a live model, and not have to save the model to file and have the reader read it?
I always thought the SDK would only read s.kp files - had no idea it could tap into a running model...
-
Would anyone be willing to provide a code snippet showing a trivial example of using C in combination with Ruby? I am still feeling kind of lost about how I could pass information back and forth between the two languages.
-
Whaat: a ruby c extension or a SU SDK one ?
-
@unknownuser said:
Whaat: a ruby c extension or a SU SDK one ?
Whatever is the simplest.... Even a 'hello world' example would be a good start.
-
the simplest is ruby extension and I showed you a link some time ago. didn't worked ?
to use SU SDK for a simple .skp page parser I made a small 8kb exe that needed 8.92 MB of .DLL files
-
@unknownuser said:
the simplest is ruby extension and I showed you a link some time ago. didn't worked ?
Heh...I never tried it because I got scared of the makefile stuff...
What interests me much more is Rubyinline. Look at the comment posted just below the blog post at the link you are referring to.
Do you think Rubyinline can be used with SketchUp? I see that it requires rubygems so this (and Rubyinline) would have to be distributed with the plugin as I see it.
-
@whaat said:
Do you think Rubyinline can be used with SketchUp? I see that it requires rubygems so this (and Rubyinline) would have to be distributed with the plugin as I see it.
no. RubyInline is just a shortcut for building extensions - you still need to have a compiler on that machine to make it work.
I also had problems make it run on my Windows machine as it doesn't like paths with spaces (v 3.6.3) and also it uses deprecated options for VC.
get started with that link, makefiles are peanuts compared with COM and finding problems in RubyInline
-
@unknownuser said:
get started with that link, makefiles are peanuts compared with COM and finding problems in RubyInline
Thanks! I will definitely try this at some point.
So, other than having full Ruby installed and a development environment such as PellesC, is there anything that needs to be done for this to work?
I would still love to see an actual SketchUp related example where you pass values from Ruby to the C extension and then back again.
-
If you ever saw SimuTerra, that was an an app that was made into a C extension from Ruby. As far as I am aware, it suffered from none of the issues mentioned by Adam. It was blazingly fast to manipulate terrains with SimuTerra. (sp?)
-
Whaat: I created a simple extension that creates a class SUExt with method add which adds 1 to the input at http://bitbucket.org/tbd/suext/src/
there are no error checking and it is a minimal example that compiles with PellesC (free C compiler) and it can be used in SketchUp
have fun
-
@unknownuser said:
Whaat: I created a simple extension that creates a class SUExt with method add which adds 1 to the input at http://bitbucket.org/tbd/suext/src/
there are no error checking and it is a minimal example that compiles with PellesC (free C compiler) and it can be used in SketchUp
have fun
Thanks so much for taking the time to do this!
-
-
I thought you were a github man?
-
@unknownuser said:
I thought you were a github man?
I like more github as a repository site but I like even more Mercurial as DVCS and I was lazy to create a bridge to git using hg-git
-
I tried once to see it was possible to use the same folder for both systems. I just set each one to ignore the repos and configs of the other. It appeared to work; at least in my simple test folder.
I tried and hg-git also, although it took some extra installation and setup. It also seemed to work just fine, although I had more warnings than I cared for - made me nervous.
Advertisement