Great thx Tig for the extra explanation
Now if only this was possible for materials to (without having to duplicate the entities first)
BTW Tig, do you know if is possible to refresh the Layer window?
@cjthompson said:
Has anyone figured out how to use threads fluidly, so that ruby and regular sketchup will work at the same time?
All attempts to use threads I've heard about had failed. Apparently it is a no-go.
@thomthom said:
I got the impression that the name was not the issue, but the path.
Right. loading a definition with the same path returns the in-model definition with the same path, and does not re-load it from disk. The name is not important, but it is the path that matters. If I save_as the definition to a new path, then load will work on the original path, and the new definition's name will be incremented.
I wanted to avoid saving the old definition to a disk file and all the mess that goes along with that - such as finding/creating a folder to save it to and cleaning it up afterward.
What I found is I can cdef.save_as("/dev/null") which will reset the path, but not actually create a file on disk. Then I am free to load the definition again - a re-load, although the definition name is incremented.
This apparently works on Windows as well as Mac even though Windows does not have a /dev/null file. Perhaps Ruby just knows how to deal with it.
Can anyone confirm this does not create a file on disk on either Windows or Mac?
@tig said:
You could also ensure that the SUp import units [set under options] matches the original DWG's units - otherwise it can become too small anyway...
YES!!! it works too. Thanks.
something like this:
def pointBetween(a,b,c)
array = [[a.x.to_f,b.x.to_f],[a.y.to_f,b.y.to_f],[a.z.to_f,b.z.to_f]]
x = c.x.to_f.between?(*array[0].sort)
y = c.y.to_f.between?(*array[1].sort)
z = c.z.to_f.between?(*array[2].sort)
return x && y && z
end
I'm not saying it will work, I'm just wondering whether it will or not.
I've used Tkinter with Python. It gives excellent results in about half the code wx requires. It's set of widgets isn't as extensive as wx, but it's much better than JavaScript's tiny set.
@kat said:
I don't get the
tangent = (normal * binormal)
multiplication. Isn't B supposed to be the cross product of N and T?
Makes no odds. Binormal and tangent both lie in the plane.
@kat said:
And why is gives
@adamb said:
(xform * binormal).length * (xform * tangent).length
you the scale factor?
I'm taking the unit vectors in the plane of the face and transforming them by the Group transform which may scale them. Getting the length in the binormal and tangent direction allows me to figure out how much to scale the area of the face accounting for the transform.
Adam
why don't we just start discussing Lua while we're at it?
no, but seriously
Python is just a different language. I learned to use it before ruby, but then I discovered ruby, which I prefer for many reasons other than it's speed, which as mentioned is slow. Yes compulsory indentation is nice in some respects, but it is a complete and utter pain when mixing tabs with spaces (can't see where the problem is). Ruby allows for more creative formatting of the code (which can be very nice). I like them both, and don't we all wish the best of both could be combined?
Just for the record.
I found this: http://www.rubyonrailsftw.com/lessons/28, after posting.
@unknownuser said:
If you get this error, you need to install 2 openSSL .dlls:
Get openssl
Download openssl windows binary from
http://gnuwin32.sourceforge.net/packages/openssl.htm
Unzip “libeay32.dll” to ruby\bin.
Unzip “libssl32.dll” to ruby\bin and rename it to ssleay32.dll
In some systems, you need to put those dlls by force on windows/system32, or on ruby/bin, if you are not running SU's ruby interpreter.
Yes 'Qbrick' can be useful to split intersecting arcs/circles before import, but you need AutoCAD !
So, importing a 3d dxf and using my tool to adjust the segmentation of any eligible arcs/circles seems the only way otherwise...
Here's the latest reply which I can just about understand.
@unknownuser said:
Unfortunately Sketchup API is hidden in compiled C library thus RubyMine doesn't understand it. RubyMine is able to parse only libraries written in Ruby + standard C-based Ruby interpreter core libraries. Please submit an issue at http://youtrack.jetbrains.net/issues/RUBY. It is possible to create/generate ruby stubs for Scetchup (similar which RubyMine uses internally for codeinsight related to Ruby core libraries) and it isn't too hard. At current moment this is a low priority issue and only a few users asked us to implement it.
I am not sure I am the right person to submit an issue. Please let me know if you are willing to take it on.
Being totally ignorant on the subject of ruby scripting I think I will buy this book and gain some insight. It looks to be good value at $32.
I also notice that the author, Matthew Scarpino, says in Chapter 1: Introduction to SketchUp Scripting
For further support with SketchUp scripting, you can't do much better than http://www.sketchucation.com
http://www.autosketchup.com/
[image: ht4a_AutomaticSketchUp.jpg]
Hi and thanks for everybody who has taken the time to read my post. I'm not a programmer but would like to make this plug-in, so I'm wondering if someone can help me find similar plug-ins or codes that would help me understand and program it. Thanks.