TurboCAD Forums

The Ultimate Resource for TurboCAD Knowledge

Register
 
Remember to do a search before you ask a question!!!

What do we know about Ruby?
Read 4973 times
March 10, 2011, 08:15:59 AM
http://en.wikipedia.org/wiki/Ruby_%28programming_language%29

We know some cool stuff has been done in it in Sketchup.

How long does it take for a newbie to learn to become capable using it?

What learning resources are recommended?

What would we like to achieve with it?
(I would most like a good bill of materials with size info which can extract from within and without groups and blocks, outputting to a .csv file).

Just how controllable is TC 18 via Rubyscript, and would we like additional controllability?

How stable is it?

Logged
Alan.
Platinum 21. & Deluxe 21.
TC user since 1995. (version 3)


* March 13, 2011, 04:32:02 PM
#1
Hallo Alan, for partlists don´t wait for ruby, try this one:

Start Tcad, open drawing (don´t forget to  backup), select the layers You need,
select hidden line rendering ( because of 2d graphics which shouldn´t be in the partlist )
and run partlist.vbs. Now wait a little bit - on my P4 dell optiplex with 70 3d parts its about
20 - 30 seconds. partlist file with .csv extention is in same directory as the tcad file.


mike 

Logged


March 13, 2011, 05:16:33 PM
#2
Hallo Alan, for partlists don´t wait for ruby, try this one:

Start Tcad, open drawing (don´t forget to  backup), select the layers You need,
select hidden line rendering ( because of 2d graphics which shouldn´t be in the partlist )
and run partlist.vbs. Now wait a little bit - on my P4 dell optiplex with 70 3d parts its about
20 - 30 seconds. partlist file with .csv extention is in same directory as the tcad file.


mike 
Hi Mike, thanks. Do you think that will work in version 16pro or will I need to download a trial of version 18 to try that out?

Logged
Alan.
Platinum 21. & Deluxe 21.
TC user since 1995. (version 3)


* March 14, 2011, 11:26:40 AM
#3
Hello Alan,

I tried the script with v10(US), V12.5(German) and V16(US) without any problems. Because of internal overhead the former releases ran faster than the newer ones. 
Another note: be aware of parts which are not lying orthogonal in space - parts of cabinets under roofs
and so, until now i didn´t implement a routine to ask the parts longest triangle and switch therefore the
workplane - this would be much vector arithmetics.  So if You get a part with abnormal dimensions for
example height of a part from 19 mm board would be shown as 45..... you must dimension this parts manually. But for most tasks in our cabinet shop its ok.  Another advantage is the integration of the
object ids in the list. Here you have the chance if you identify the rests of parts of slicing operation and you can delete them with control -q and their object id.   
If  I don´t answer your questions in future - its because of problems I and other users in Germany have with  the access to the user forum most times access is denied - ask per mail  **info**at****devodip**** . de  (delete asterisks and spaces).

mike

Logged


March 14, 2011, 04:59:59 PM
#4
Hello Alan,

I tried the script with v10(US), V12.5(German) and V16(US) without any problems. Because of internal overhead the former releases ran faster than the newer ones. 
Another note: be aware of parts which are not lying orthogonal in space - parts of cabinets under roofs
and so, until now i didn´t implement a routine to ask the parts longest triangle and switch therefore the
workplane - this would be much vector arithmetics.  So if You get a part with abnormal dimensions for
example height of a part from 19 mm board would be shown as 45..... you must dimension this parts manually. But for most tasks in our cabinet shop its ok.  Another advantage is the integration of the
object ids in the list. Here you have the chance if you identify the rests of parts of slicing operation and you can delete them with control -q and their object id.   
If  I don´t answer your questions in future - its because of problems I and other users in Germany have with  the access to the user forum most times access is denied - ask per mail  **info**at****devodip**** . de  (delete asterisks and spaces).

mike
Thank you Mike. I just tried to use it with TC 11.1pro but I couldn't find the file it claimed to have generated, so I will try again on another occasion. Sounds encouraging, thanks again! Best regards, Alan.

Logged
Alan.
Platinum 21. & Deluxe 21.
TC user since 1995. (version 3)


* March 14, 2011, 11:49:11 PM
#5
Hi Alan,

if your tc file would be for example "c:\project\test.tcw"  the generated file should be "c:\project\test__partlist.csv".


mike 

Logged


March 15, 2011, 02:57:30 AM
#6
Thanks Mike. Ok I got it to work, but anything in a block is listed as total size of bounding box of block, ie it doesn't look inside a block and list the contents of parts in a number of blocks. That is what I so like about the old Bill of materials vba plugin by Dan Hunting all those years ago for Version 7 and earlier, updated to 8 and I think 9 though I do have an update he did for version 10.5.

I am impressed though that this has been possible, and wonder if it might be further developed to 'look inside' blocks as well.

Logged
Alan.
Platinum 21. & Deluxe 21.
TC user since 1995. (version 3)


* March 15, 2011, 11:35:39 AM
#7
Hi Alan,

I will implement the function to look into a group or block when I´ll have time enough to do that.
For now a workaround would be to look at the object-type if there are any blocks or groups listed,
make a copy of them manually, explode the copies and select them, run the macro and put the result
together into the basic list.

mike 

Logged


March 15, 2011, 11:56:20 AM
#8
Hi Alan,

I will implement the function to look into a group or block when I´ll have time enough to do that.
For now a workaround would be to look at the object-type if there are any blocks or groups listed,
make a copy of them manually, explode the copies and select them, run the macro and put the result
together into the basic list.

mike 

Thanks Mike, did you write this yourself? I am impressed. Regards, Alan.

Logged
Alan.
Platinum 21. & Deluxe 21.
TC user since 1995. (version 3)


* March 15, 2011, 11:30:07 PM
#9
Hi Alan,

i dont´t understand your question. Of course I wrote the code and the posts to the board by myself.

mike

Logged


March 16, 2011, 02:05:32 PM
#10
Hi Alan,

i dont´t understand your question. Of course I wrote the code and the posts to the board by myself.

mike

Mike, sorry, I wasn't being funny, no I meant did you write the SDK script, it is an area of expertise I do not know anything about, which is why I was asking. Best regards, Alan.

Logged
Alan.
Platinum 21. & Deluxe 21.
TC user since 1995. (version 3)