how to get a list of all faces with their backs facing the camera. PLEASE HELP
or even a list with all faces facing the camera
Posts
-
All faces with their backs facing the camera.
-
How make a window like the components window
how make a window like the components window as an interface to represent a new class i made called Buildings
-
RE: Over right the face class
Tig you are right, using AttributeDeictionary is the right way to go and does exactly what i need.
Thank you -
Orient Faces
There is a great tool in Sketchup tools called "Orient Faces" that its meant to turn all contiguous faces the same way as the one selected. Does anybody know how to invoke this tool in ruby script?
For example i can make a list of certain faces that I’m sure they are properly oriented and then get all other faces connected to these faces and have them oriented to the ones I’m sure off using this function -
Over right the face class
Is there a way to over right the face class and add more functions to it?
What I’m trying to do is add a Boolean attribute generically to the face class called looked_at.
So that when i do my calculations i can check this variable and see if that face was looked at or not yet -
Face front side outwards
Hi All,
I have a model of 300 buildings. I’m trying to apply certain materials to some facades on the model. But some of the facades represented by faces are inside out. Each face in sketchup has two sides and some of the faces in my model have the back side facing outwards of the building.
My question is “Is there a code or a plugin to use to flip all the faces that have the back side facing the outwards at once?”Thanks in advance
-
How to identify buildings in Sketchup using ruby?
Hi guys,
i was looking so ways to identify buildings in sketchup. one of the ideas i was thinking of is to search for 6 connected faces.. not very sufficient it was a start.
any ideas to share?? -
RE: How to draw an edge with an angle and distance
Mission accomplished
Thanks to you all Geniuses -
RE: How to draw an edge with an angle and distance
guys i think you are right, the hits array is empty. the ray isn't hitting any geometry. Still trying to find out why though
-
RE: How to draw an edge with an angle and distance
Tig it isn't working.
guys could u have a look at the code and tell me what do you think?...*[snip]*... reposted [in later post](http://forums.sketchucation.com/viewtopic.php?f)
-
RE: How to draw an edge with an angle and distance
Error: #<NoMethodError: undefined method
[]' for nil:NilClass> C:/PROGRA~1/Google/GOOGLE~3/Plugins/Fire Arrows.rb:31 C:/PROGRA~1/Google/GOOGLE~3/Plugins/Fire Arrows.rb:7:in
each'
C:/PROGRA~1/Google/GOOGLE~3/Plugins/Fire Arrows.rb:7
C:/PROGRA~1/Google/GOOGLE~3/Plugins/Fire Arrows.rb:3:in `call'Sorry if i wasn't clear enough
-
RE: How to draw an edge with an angle and distance
Tig it isn't working.
guys could u have a look at the code and tell me what do you think?require 'sketchup.rb' UI.menu("PlugIns").add_item("Fire Arrows") { ents = Sketchup.active_model.entities Sketchup.active_model.selection.each do |e| if e.is_a? Sketchup;;Face ce=e.bounds.center en=ce.offset(e.normal, 100000.mm) cl90=ents.add_cline(ce, en) #a vertical line tr=Geom;;Transformation.rotation(ce, Z_AXIS, 45.degrees) en.transform!(tr) cl45=ents.add_line(ce, en) #a 45 deg line vec=ce.vector_to(en) dist=ce.distance(en) hits=[] pt = Geom;;Point3d.new pe=ce.clone ### set up a copy of the point to raytest from goon=true while goon rayt= Sketchup.active_model.raytest(pe, vec) goon=false if not rayt pt=rayt[0] hit=rayt[1][0] goon=false if ce.distance(pt) > dist hits << [pt, hit] pe=pt ### look from last hit point... end#while hits.each do |s| if s[1][0].is_a? Sketchup;;Face hit_face = s.bounds zmin = hit_face.min.z zmax = hit_face.max.z h = zmax - zmin h = h.to_m UI.messagebox s[1][0] UI.messagebox h end end tr=Geom;;Transformation.rotation(ce, Z_AXIS, -90.degrees) en.transform!(tr) cl135=ents.add_cline(ce, en) #a 135 deg line #en=ce.offset(Z_AXIS, 5000.mm) #tr=Geom;;Transformation.rotation(ce, X_AXIS, -45.degrees) #en.transform!(tr) #cl135=ents.add_cline(ce, en) #a 135 deg line #tr=Geom;;Transformation.rotation(ce, X_AXIS, 90.degrees) #en.transform!(tr) #cl135=ents.add_cline(ce, en) #a 135 deg line end end }
Thanks Dan,
i added the two end statements. but the complier doesn't like line 31 ]pt=rayt[0]
thanks again Dan
-
RE: How to draw an edge with an angle and distance
Guys sorry i don't mean to be pushy, put after i fired the arrow from centroid I’m looking for a built in function in either add_cline or even add_line to retrieve all the faces that intersect with my line.
-
RE: How to draw an edge with an angle and distance
Thank you so much guys I’m starting to feel like you are magicians
-
RE: How to draw an edge with an angle and distance
yes i want to draw construction lines from centroid for a distance D with angle A
Any ideas?
i looked at the links and i still can't see how can i specify an angleP.S i don't know the coordinates of the point the arrow going to stop at
-
How to draw an edge with an angle and distance
Hi all,
As i found the best ruby programmers on this forum, i was wondering if anybody can help do this:
i managed to work out centeroid of a face now i need to fire three arrows from the point vertically with angels of (45, 90, 135) degrees.
i know that i can make an edge giving two defined points.
edg = ents.add_edges point1, point2But is there any way to draw an edge with a certain angle and a giving length of 500 MM for example??
-
Rounding
Hi everyone,
As you all know i'm knew to Sketchup ruby and i can't find this anywhere online.
I have a variable that has a float number and i wanted to round it.Var = 1.8854523497846
Desired answer Var = 1.9Also if i can recommend any online sources for Sketchup ruby I’ll be thankful
Thanks
-
RE: Detect units using ruby
@thomthom said:
Look at
model.options
http://code.google.com/apis/sketchup/docs/ourdoc/model.html#optionsOptionsProvider
http://code.google.com/apis/sketchup/docs/ourdoc/optionsprovider.html
OptionsManager
http://code.google.com/apis/sketchup/docs/ourdoc/optionsmanager.htmlRemember to use the keys to access the options as indexes vary from version to version.
To print out all available options for a given version, use this on-liner:
<span class="syntaxdefault"><br />Sketchup</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">active_model</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">options</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">keys</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">each </span><span class="syntaxkeyword">{|</span><span class="syntaxdefault">key</span><span class="syntaxkeyword">|</span><span class="syntaxdefault"> p key</span><span class="syntaxkeyword">;</span><span class="syntaxdefault"> Sketchup</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">active_model</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">options</span><span class="syntaxkeyword">[</span><span class="syntaxdefault">key</span><span class="syntaxkeyword">].</span><span class="syntaxdefault">each </span><span class="syntaxkeyword">{|</span><span class="syntaxdefault">k</span><span class="syntaxkeyword">,</span><span class="syntaxdefault">v</span><span class="syntaxkeyword">|</span><span class="syntaxdefault"> puts </span><span class="syntaxstring">"> #{k} - #{v}"</span><span class="syntaxkeyword">}</span><span class="syntaxdefault"> </span><span class="syntaxkeyword">}<br /></span><span class="syntaxdefault"> </span>
THANK YOU VERY MUCH. it worked