Thanks for the replies guys!
@unknownuser said:
That is correct. Most methods of classes are instance methods. You should be able to call them from inside the class (ie another method of the same class,) using it as a private method.
Yes it is an instance method, but it seems to have no effect on objects created in the sketchup ui, presumably because they have their own read-only/inaccessible templates/classe for creating objects?
And yet I still fail to see why rewriting the instance variable declaration (if that's what it's called!) for x, y, z has an effect on yaml. Have they not already been declared? I just have a funny feeling that something weird is going on under the hood.
I actually had no real purpose when extending those classes, except to try and get them to expose x, y, z values to yaml. It worked in that instnce, I have no Idea how, and was unable to do anything similar for other types. The workaround only partially worked (ie, it does not work on objects created in the sketchup ui).
@unknownuser said:
You can do anything you want FOR YOUR OWN USE.
BUT Google OWNS the Sketchup, UI, and Geom Namespaces. The Terms of use prevent you from causing other people's installations of Sketchup to be degraded or broken or such. The license agreement is at: http://sketchup.google.com/intl/en/download/license.html
At the very least, if you wanted to extend Sketchup classes (and release those extensions,) you'd need to have Google Sketchup Team consent AND Sketchup Developer Community approval.
You might join the SKX project, or monitor the SKX forum.
Normally I would have given up trying to get yaml to work and come up with my own alternative way of transmitting the object information via text through stdio, but I have thought of another interesting concept, the possibility of using other languages such as python or java with sketchup... with yaml. If there is no interest in that, and I can't find a quick fix to this problem I have with yaml, then I'll drop that Idea! π
I think I need to learn how yaml works (on the inside) in order to find out why it struggles with sketchup. π
I did have one Idea for a work around, and that was to deep copy the objects created in sketchup to what I have dubbed (if my theory is correct) a "True Ruby Object" and then use the .extend method to append the yaml methods on the objects. In order to do this I guess it would be easiest to make the change to the way yaml works (otherwise I may as well just copy all the attributes manually!).
By having my own copy of the objects, and then using the .extend method will I still be voiding this license aggreement?
A big problem I think I can see with that Idea is performance. Having a copy of every object doesn't seem like good, common sense to me!