Pushpull scripting. need HELP plz
-
hello folks, i need ur help plz
i was trying to script the pushpull command on sketchup ruby, just immitating the tutorial ( http://www.youtube.com/watch?v=Aq1YEaI2XlA&feature=related ) but unfortunately it didnt work, so i guess ther is a step missing or something going wrong...if u can help it ll be soooo cooool,,,thanxxxx
-
Well, its hard to say if your doing something wrong, without seeing anything you've done
But I will say that I'm pretty sure that the video is accurate, as it is written and tested in real time in the video - no Hollywood magic pushpulling the faces or anything.
So why not post a snippet of your code you are working on we'll see how it looks!
Chris
-
hey i m walid s friend
wr r working together on this project
and here is the code we tried to enter yesterday
but unfortunately it didnt workthe basic of our work is to find out how to make a plugin that digs a cube randomly into different multi geometrial shapes with different sizes and so on...
thank uuuu
model = Sketchup.active_model sel = model.selection model.start_operation "mult. pushpull" faces = [] sel.each do |e| faces << e if e.is_a? sketchup;;face end faces.each do |face| face.pushpull [ 100 ] end model.commit_operation
-
face.pushpull [ 100 ]
NOface.pushpull(100)
or even
face.pushpull 100
YES[]
encloses an 'array' - e.g. a 'list' of things like [0,0,1] - the three points x,y,z
()
or<space>
simply separate the arguments from the method...pushpull
takes a distance not an arrayHere you are pushpulling every face
100
units (inches) in the direction of the face's normal (front face)
To use other units use a suffix like100.mm
for millimeters -
hi TIG i have tried the script in the way u told me 2 but no result..
i hav noticed that on the u tube tutorial the command was EXECUTE
on my sketchup it is EVALUATE so does that mak difference ?
if yes ... how can i download the execute command...
thanx -
Hi guys, the "
execute
" versus "evaluate
" difference is nothing. It is just a different version of the same tool. They work exactly the same.Fix what TIG suggested and then fix this line:
faces << e if e.is_a? sketchup::face
the word sketchup is a class and needs to be capitalized, and so should the word face (I think). So it should read like this:
faces << e if e.is_a? Sketchup::Face
Try changing that too and see if it works. Ruby is case very sensitive!
Chris
PS Sorry I have been slow to respond here, and I just got your PM also. My computer broke and I have been without internet at home for a few days. But all hard drives are replaced, new motherboard in, new RAID card up and running and I think I might have a useable computer again. Good luck!
-
OK, just got Sketchup and the web console installed on my system so I could test this out. Sure enough, making TIG's changes, plus the ones I showed above, and it all works. This is the final code:
model = Sketchup.active_model sel = model.selection model.start_operation "mult. pushpull" faces = [] sel.each do |e| faces << e if e.is_a? Sketchup;;Face end faces.each do |face| face.pushpull 100 end model.commit_operation
There you go! Let me know how the other tutorials go also!,
Chris
Advertisement