entities.add_group(old_entity)
Posts
-
[Plugin] Remove Inner Faces
@unknownuser said:
Plugin added below under this link.
Does exist a ruby script for kill the internal surfaces but not the edges of these surfaces (after a Pushpull + Ctrl for example)?
Why? Because when you export a Su file in OBJ to Zbrush for example, these intenal faces were not erased and make some disturb!
Resolved see here Thx Wikii & Matt666
-
RE: Loop Selection Tool?
I have just finished one.
Will be released in few days -
RE: [ruby doc] Entities.add_group
Great,that is a very useful information!
-
[Plugin] SUTool 0.38 english version released
SUTool_strings.txt is the language file .
-
What's new in SUTool 0.3
Generate Toolbar automaticly
Mouse_over_show command area
Double click to edit setting file
and more...
-
RE: In Development: Subdivide and Smooth
I wrote script below to simulate whaat's.It works,but not perfect
class Smooth_contours attr_reader ;author,;date,;ver def initialize @author="Wikii" @date="20080402" @ver="0.01" @mm=Sketchup.active_model @fs=@mm.selection.to_a.delete_if{|x| x.class!=Sketchup;;Face} do_Smooth_contours if @fs.length>0 end def center_point point3ds re=Geom;;Point3d.new(0,0,0) num=0 0.upto( point3ds.length-1){|x| if point3ds[x].class==Geom;;Point3d re.x+=point3ds[x].x re.y+=point3ds[x].y re.z+=point3ds[x].z num+=1.0 else #weighted re.x+=point3ds[x][0].x*point3ds[x][1] re.y+=point3ds[x][0].y*point3ds[x][1] re.z+=point3ds[x][0].z*point3ds[x][1] num+=point3ds[x][1] end } re.x/=num re.y/=num re.z/=num re end def open_vertex? v v.edges.each{|x| return true if x.faces.to_a.delete_if{|y| !@fs.include?(y)}.length<2 } return nil end def face_center fc Geom;;Point3d.new center_point(fc.vertices.to_a.collect{|xx| xx.position}) end def do_Smooth_contours group_entities=@mm.active_entities.add_group.entities vertices=[] vertices_info={} @mm.start_operation "123" n=0 @fs.each{|x| n+=1.0 Sketchup;;set_status_text "Finished #{(n/@fs.length*1000).to_i/10.0}%" cen=face_center(x) x.vertices.each{|y| if !vertices.include?(y) and !open_vertex?(y) vertices<<y #~ tmp0=y.position #~ tmp=center_point(y.faces.to_a.collect{|z| [face_center(z),z.area]}) tmp=center_point(y.faces.to_a.collect{|z| face_center(z)}) #~ tmp0.z=(tmp0.z+tmp.z)/2.0 #~ tmp0.z=(tmp0.z+tmp.z)/2.0 #~ vertices_info[y]=center_point([tmp,tmp0] ) vertices_info[y]=tmp end } } @ee=Sketchup.active_model.active_entities puts @ee vertices.each{|x| t=Geom;;Transformation.new(vertices_info[x]-x.position) @ee.transform_entities(t, x) } @mm.commit_operation end end Smooth_contours.new
-
RE: [ruby doc] Undocumented send_action commands
Can "Paste in place" be used by Sketchup.send_action method?
-
Using open-uri or net/http to download a file from web?
Hi all!
Can I use open-uri or net/http to download a file from web in SU? -
RE: Save As (exporting geometry)
I also want a script to export dwg file with select entities.
-
Shadow study using SU2WEB
http://www4.zzu.edu.cn/arch/sutool/shadow/test.htm
Maybe very slow to show. -
How get the Group object contains the particular entity
Hi all,I want to get the Group object that contains the selected objects.
such as:First I select a Group Sketchup.active_model.selection[0] => <Sketchup;;Group;0xb79eb20> I open it ,and ,select an edge Sketchup.active_model.selection[0] => <Sketchup;;Edge;0xb79ea48> Now I want to get the Group object contains '<Sketchup;;Edge;0xb79ea48>' ,that should be '<Sketchup;;Group;0xb79eb20>'.Using 'parent' methods,it can't work at all. Sketchup.active_model.selection[0].parent => #<Sketchup;;ComponentDefinition;0xb79e958>
Please help me.
-
RE: [Plugin] SUTool: a new way to manager your RB script
@fletch said:
ok, Wikii, thx!
got a screenshot of the exact place/way I would do this? (I'm no programmer! )Edit CSS file.
Replace 'width:89px;' with 'width:150px;',4 places
Replace 'width:110px;' with 'width:170px;',2 placesRefresh SUTool window.
-
RE: [Plugin] SUTool: a new way to manager your RB script
@fletch said:
2nd - Wikki, when a name is very long for the ruby script description, the box cuts off the name of the file... so you almost can't tell what it is in some cases. If possible, do you think in the future you will be able to make it so that when you re-size the window it will also re-size the rectangles to show the whole ruby name?
PLZ,edit SuTool.css file to resize the width of cmd button that been showed in SUT window.