Someone might be interested in using c# and .net stuff.
I created a very simple example to write a ruby extension in c#.
https://bitbucket.org/icehuli/sucsexttutorial
extension using c#
9 posts
• Page 1 of 1
Re: extension using c#Cool! That's very interesting.
Last week I was working on a Ruby C Extension in C++ and I started to write a thin wrapper over the Ruby C code so that I could manipulate them as C++ objects. It'd be nice with a set of wrappers like that the various languages.
Re: extension using c#
ALL tutorials should show ALL objects being created INSIDE an Author's toplevel module. We usually use the module name Author or AuthorNamespace or CompanyNamespace, etc., do denote that the end user should replace that name with their own toplevel module name. Only Ruby and the API (in rare cases,) should ever create classes at the toplevel (aka TOPLEVEL_BINDING.) ![]()
Re: extension using c#
Thanks for the reminding. Re: extension using c#in case somebody using it, added a new project "IHL_CsR22ExtApp0" for Sketchup 2018/2017 x64 with ruby 22
Re: extension using c#Interesting stuff indeed, and nice job Icehuli!
It looks like you are wrapping a lot of Ruby-communication-code into C#. Does it work well ? How is the performance ? Ive read the UnmanagedExports-package puts a bit of overhead. Was rather old info, I'll be intreseted to know if it has been improved. I'm working on a similar project with a WPF application. In my project I use a different pattern in using a C++/Cli "Bridge-layer" with a C++/cli ref-class that subclass the WPF app. Then I can use that class to communicate with C++ as normal through exporting the required functions. This means off course writing the bussiness-layer and Ruby-Communication layer in C++, and (for the most part) only using C# for the front-end. I had some problems running the application if I did not put the assembly in the same folder as Sketchup.exe. I don't want to hijack your post but it would be interesting to hear if you have any experience with this. The solution I found is to handle the event when the Appdomain cant locate an assembly. AppDomain ResolveEventHandler This SO-topic has some code: https://stackoverflow.com/questions/137 ... ime-in-net (msarahan C++/Cli version a bit further down). This requires a longliving Application though. I could also possibly explicitly load the assembly, and then use reflection to create an instance. But it becomes quite complicated when I want to use a C++/Cli ref class as subclass. I wonder what the policy is regarding putting dll's in the Sketchup folder ?
Re: extension using c#
Interesting and nice job Icehuli! I currently working on your C# project "IHL_CsExt0" .After successfully build your code I connected this with SketchUp 2023 but I got exception at following function :
exception occurs :: 1.Exception thrown at 0x00007FF99A750EB6 (x64-msvcrt-ruby270.dll) in SketchUp.exe: 0xC0000005: Access violation reading location 0x000000006F21B998. 2.System.AccessViolationException: 'Attempted to read or write protected memory. This is often an indication that other memory is corrupt.' 3.kernelbase.pdp Not Loaded Currently using :: SketchUp 2023 with "x64-msvcrt-ruby270.dll" in visual studio 2019. framework=.net 4.5 also add post build event to copy "IHL_CsExt0.so" file (SketchUp)Plugin folder Can you please help me out for this issue. Thank you In Advance! Re: extension using c#may be the recursion?
rb_define_module_function(module, name, func, 2)
9 posts
• Page 1 of 1
|
Who is online
Users browsing this forum: kartoon98 and 12 guests