I need a script
-
I need a ruby script that works just like the "rectangle.rb", but does NOT make a face. I looked at the script, and found the line that tells it to make the face. I tried deleting that line, but then it stopped working completely. I don't know much about ruby, so I was hoping someone could reply with the script I need.
-
You could try changing line 110 from
Sketchup.active_model.active_entities.add_face @pts
totrue
. -
Try changing the line 110 from:
Sketchup.active_model.active_entities.add_face @pts
to:
f = Sketchup.active_model.active_entities.add_face @pts Sketchup.active_model.entities.erase_entities f
That is then pointing the variable f to point to the face that was made. The next line then deletes the face. But that will leave the edges behind. It could be a bit problematic if this rectangle is drawn over existing geometry though. I suppose the better way would be to just draw the lines individually, which is also pretty easy.
Maybe I'll write that up later. or maybe someone else will.
Chris
Ope, remus already posted. Oh well try them both.
-
Without reworking it to draw just four edges rather than make a face_with_its_four_edges, you can recast it to make the face and then erase it immediately - its four edges should get left behind...
lines 107 et al...
def create_rectangle # check for zero height if( @pts[0] != @pts[3] ) face=Sketchup.active_model.active_entities.add_face @pts face.erase! if face.valid? ### edges will remain... end self.reset end
EDIT: CF beat me to it !
Advertisement