-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add some examples with substance. #20
Comments
Got a Ruby equivalent for what you are looking for?
The main purpose of this example has been to provide the headers and lib along with project setup to compile a Ruby C extension that runs within SketchUp. For that it has served well. I can see that there are opportunities to do more with the examples. (However, just because it isn't 100% what you expect doesn't mean it isn't useful for others. And there any many ways to suggests improvements in more positive constructive language.) Also, Pull Requests are welcome 😉! |
Observation: Your adding of an inner loop is the kind of thing that makes a good example ... https://forums.sketchup.com/t/how-to-create-a-hole-using-the-inner-loop/74239/3 ... but is probably more suited to the Live-C example repo: https://github.com/SketchUp/sketchup-live-c-api |
Are you looking for examples on how to use Ruby's C API? How to make method calls to Ruby from C? |
Not specifically. This topic is about "examples with substance" ... But specific to your question, I've often posted links to the companion book for "Writing Ruby Extensions in C". It is informative although quite old now. (It was written when Ruby 1.9 was current.) |
The main purpose of this example repo is setting up the project, along with providing the headers and libs. My experience with Ruby C extensions was that writing the code was the easy part, but getting a project setup to compile and link was the hard part. My go-to reference for the Ruby C API is this one: https://silverhammermba.github.io/emberb/c/ |
Okay this is nice ... BUT ... your taking this discussion off-topic. Again, this is about examples of using the SketchUp C API. Showing tasks that are NOT obvious to new users of the C API and probably know little of how SketchUp works. (Ie, they need to write an importer for a 3rd party application, etc.) For example, ... the question you answered today about copying text objects from model to model. There is no explanation that an exception will occur if a text object's font is not set. There are other tasks also using the SU C API where the order that things are done must be correct. |
I'd say such examples fit better in pure C API examples. They are not tied to Ruby C extension or live C API. (I fully agree that we need better C API examples.) |
The Hello World is a silly and meaningless example.
Add some examples with substance. Something that at least looks up some SketchUp model properties and displays them.
The text was updated successfully, but these errors were encountered: