Thanks for the reply and the interesting idea. Like I said I am a novice at this so I'm not sure how, but maybe someone can think of a simple line or two I could add before the loop repeats that would add the newest geometry into an existing group. Than each time the loop goes through it will continuously add that ever is new into that same group.
Latest posts made by Jackjack123
-
RE: Trying to improve the speed of a simple script
-
Trying to improve the speed of a simple script
Hi. I have a very basic ruby script I have been playing with in sketchup. I read a text file with four values separated by spaces. They represent an x, y, z coordinate followed by a forth number (which represents a height). This text file can have many of these points/height values (all on separate lines). At each point I draw a shape by calculating out 3 other corners as P2, P3 and P4 then doing the following:
face = entities.add_face pt1, pt2, pt3, pt4
face.pushpull (height), trueIt is a very simple script. I am finding that as I add more lines to the file it takes a much longer time for each file to process (so the relationship appears not to be linearly related to the length of the file).
I believe this is because every time I use pushpull, sketchup is checking to see if the new shape intersects existing geometry (which increases each time the loop runs through the file).
If there was a way of either stopping this geometry check (or delaying it until all of the boxes have been built...) I bet that would do it. I’m a fairly novice programmer so Ruby is a bit out of my league but I am managing.
Can anyone think of a way I could speed this up?