11 messages in com.googlegroups.sketchuprubyRe: how to get objects and its face ,...
FromSent OnAttachments
haib...@gmail.com14 Jul 2007 07:17 
Todd Burch - Katy, Texas14 Jul 2007 08:22 
belgabor14 Jul 2007 08:47 
haib...@gmail.com14 Jul 2007 20:18 
haib...@gmail.com14 Jul 2007 20:19 
haib...@gmail.com14 Jul 2007 20:27 
Todd Burch - Katy, Texas14 Jul 2007 20:47 
haib...@gmail.com15 Jul 2007 01:02 
BillW16 Jul 2007 15:42 
haib...@gmail.com17 Jul 2007 19:03 
haib...@gmail.com24 Jul 2007 20:29 
Subject:Re: how to get objects and its face , vertex information by ruby ?
From:Todd Burch - Katy, Texas (mr.t@gmail.com)
Date:07/14/2007 08:22:19 AM
List:com.googlegroups.sketchupruby

1. collect all objects in sketchup scene .

All entities are in Sketchup.active_model.entities

2. loop each object , and get all faces of it .

all_faces = Sketchup.active_model.entities.each {|e| all_faces.push(e) if e.is_a? Sketchup::Face }

(this does not drill into groups or components)

3. get each face`s points position value and the face`s normal value ,

all_faces.each {|f| puts "\nface's normal=#{f.normal}" f.vertices.each {|v| puts "\tvertex = #{v.position}" } }

then output them to a text file .

You can change the "puts" instruction to the IO write method of your choice.

btw: i have searched in sketchup classes and mathod reference , and for i newbee, hard to find informations .

The Hekp>Ruby Help will only tell you about the SU Ruby API, not how to program in Ruby. For that, see www.ruby-lang.org and follow the links.

Todd

(P.S. I did not syntax check anything)