First, there is no reason the change the component.definition.name only the component.name which is the only thing that the plugin checks for. If you select those components that you want to use as the Source set then, from the ruby console, "Sketchup.active_model.selection.each{|c| c.name='Source'}" will properly identify them as the Source set. Substitute 'Target' for 'Source' to identify the selected Target set.

Posts
-
RE: [plugin]Random replacement of components
-
[plugin]Random replacement of components
In response to http://forums.sketchucation.com/viewtopic.php?f=323&t=37434 and others, I have written a plugin to accomplish this given two sets of components, a source set and a target set. These sets are identified by giving all the members of the set the same component name. Components also have a definition name which is what is entered when the component is created. The component name is displayed and can be assigned in the Entity Info panel. The appearence of a component is determined by the definition assigned to it by the definition name. If a sub-set of target components are pre-selected, then only those will be randomly changed.
-
[plugin] Volume By Slice (Updated 27-Mar-2014)
Updated to be SU2014 compatible.
Compute the volume by slices of a given selected "solid" 3D shape.
http://forums.sketchucation.com/viewtopic.php?f=79%26amp;t=38020
The front and back faces are assummed to be vertical. If there are other vertical faces,
deselect them before running the plugin. Only edges that connect to the "front" face
vertices are used. Hidden and soft edges are ignored. The area and volume data are
written to a text file.
-
RE: Quantities from model
jemagnussen, My volumn plugins doesn't create any "solids" it only creates faces at 1m intervals. Using Sketchup's face.area gives the area of the face and I just average the areas of the adjacent faces to obtain the volume of that "slice" and write that out to a text file. That's all I thought you were looking for.
-
[plugin] Select Faces by Area
Somehow between testing and uploading, I managed to screw up the previous fbs.rb I uploaded. If you have downloaded and tried the plugin only to get a "method" error, please download it again.
fbs.rb selects faces based on their area. Faces in groups and components are checked along with all other faces in the model. Since the plugin is expecting numbers to be entered for the maximum and minimum areas, an empty entry is not valid.
If the "Area <" is less than the "Area >" an OR selection is made and all faces with an area less then the "Area <" value or an area greater than the "Area >" value are selected.
If the "Area <" value is greater than the "Area >" value an AND selection is made and all faces with an area greater than the "Area >" and less than the "Area <" value are selected.
For example, Area < 1000 and Area > 0 selects all faces with an area less than 1000. Area < 0 and Area > 1000 selects all faces with an area > 1000. Area < 2000 and Area > 1000 selects all faces with an area between 1000 and 2000. Area < 2000 and Area > 4000 selects all faces with an area less than 2000 or greater than 4000.
http://forums.sketchucation.com/viewtopic.php?f=323&t=38033
-
RE: [REQ] Selection by Surface ?
A new and improved fbs.rb is now available. Faces in groups and components are now checked along with all other faces in the model. Since the plugin is expecting numbers to be entered for the maximum and minimum areas, an empty entry is not valid.
If the "Area <" is less than the "Area >" an OR selection is made and all faces with an area less then the "Area <" value or an area greater than the "Area >" value are selected.
If the "Area <" value is greater than the "Area >" value an AND selection is made and all faces with an area greater than the "Area >" and less than the "Area <" value are selected.
For example, Area < 1000 and Area > 0 selects all faces with an area less than 1000. Area < 0 and Area > 1000 selects all faces with an area > 1000. Area < 2000 and Area > 1000 selects all faces with an area between 1000 and 2000. Area < 2000 and Area > 4000 selects all faces with an area less than 2000 or greater than 4000.
-
RE: [REQ] Selection by Surface ?
Pilou, Are you trying to select only the faces that are < 6000m2? If so, setting the Greater Than value to 1000000 should exclude everything else.
TIG, Thanks for you comments. I admit that there are many areas and ways of improving the plugin but it is just something I through together in 30 minutes or less as a starting point.
-
RE: Quantities from model
Here is my attempt to solve your problem. I made a copy of your Quantities_1.skp. Seperated and exploded the three layers of material and moved them to individual layers. To make the selections easier, I deleted the back face leaving only the front face and the edges that connected it to the back face before running the plugin. A report file is generated listing the area of each face and the volume between them.
-
RE: Any Equalize Surfaces?
unclex, My plugin DivideByMaterial sub-divides rectangular faces into equal areas.
http://forums.sketchucation.com/viewtopic.php?f=323&t=37719
The basis for that plugin is Divide Face.rb which gives you the option of dividing by a maximum size or by a given number of divisions in the x and y directions and can be used on any face painted or otherwise.
-
RE: Question plugin rectangular subdivision
jorge2011, The attached version of Mesh Maker.rb saves the previous cell size entered and will work on tilted faces, suggestions 1 and 4.
-
RE: [plugin] Divide By Material
srx, Your wish is granted. DivideByMaterial.rb now handels faces in groups and components.
-
RE: Question plugin rectangular subdivision
jorge2011, All things are possible but are they worth the effort to achieve them. I will consider your suggestions and try to impliment them if possible. I make no promises though.
-
RE: Question plugin rectangular subdivision
jorge2011, Check out my "Mesh Maker.rb". I used it on part of 01.skp as a test and on the shape in Sub-div.skp. The resulting models are attached along with the plugin.
-
RE: [plugin] Divide By Material
srx, Glad that the plugin works for you. The plugin posted to this forum doesn't require you to pre-select the faces. If there are no selected faces, it looks at all faces in the model and sub-divides the ones with the given material.
As far as groups and components go, you can sub-divide their faces if you enter edit mode before running the plugin. This selects the faces and makes them accessable.
-
[plugin] Divide By Material
This plugin was created at the request of srx who, because of rendering requirements, needed to sub-divide faces with a given material. The plugin works with a selected subset or all faces in the model with the material selected from a list of all materials present in the model. The maximum size to the sub-division is also entered. The actual size is calculated based on the dimensions of the face. The faces are assumed to be rectangular. Faces inside groups and components are accessed and processed by the plugin.
-
RE: Subdividing faces for displacement plugin
EarthMover you are right in that it is a bit redundent to have to select and specify material and is a simple change but wasn't sure if the sub-divided faces would be left in the original model or moved so selecting avoided the re-dividing of faces. Also, I didn't want to assume that every face with a given material in the model was to be sub-divided.
srx, what changes if any would you like to be made?
-
RE: Subdividing faces for displacement plugin
@srx said:
I was thinking about more automotive work flow.
1 Input - one or more materials (for example stone)
2 Output - All the faces with stone material applied are subdivided evenly (more or less). This is what displacement needs.This is kind of reversed "remove collinear edges" command - Add collinear edges
srx, The attached plugin is my attempt to automate the sub-dividing of faces with a given material. For reasons I have yet to figure out, it sometimes has a problem around window openings if the grid happens to fall a certain way. I hope you find it helpful.
-
RE: Looking to create a fairly simple plugin.
DrDyna, This would be a relatively easy plugin to create. Something like this
def getdata
file_name = UI.openpanel "Open Data File", "c:", "*.dat";#get the file name
inp = File.open(file_name);#open the file
tmp = inp.readline;#read the header
while !inp.eof
tmp = inp.readline;#read a data record
dat = tmp.split(" ")#split the record using the space character as the seperator
#process dat array
length = dat[0].to_f;
area = dat[1].to_f;
;#etc.
end