You could try cutlist its main use is for woodworking but it reports the size of all selected components.
Keith
You could try cutlist its main use is for woodworking but it reports the size of all selected components.
Keith
Thanks for the router drawing that was just what I was looking for. I will post the model again when more details are complete.
Keith
Has anyone drawn a SU plunge router that they would share with me?
I am working on a horizontal router table for making mortise cuts and would like to include a router in the drawing. I am not looking for a lot of detail just enough that it looks like a router.
This is what I have drawn so far. You can see the basic concept but there are lots of details to work out and add. I may work out the details during the building process.
Keith
Dave how do you set flip as a shortcut I didn't see it on the drop down when setting short cuts.
Keith
A question for Dave or others that have tried ver8. Have you used the Boolean tools rb that is available and if so how does it compare to the native tools in ver8? As this is only a hobby I can't see the expense of su pro however I do miss the tools that my previous cad program had for solid add and subtract.
Keith
I do leave layer0 as active all the time I just am changing the visibality to other layers. I don't a lot in sketchup as I only draw what I am going to build with the possible exception of some shop fixtures I have not actually completed. This is the desk I am currently working on and should start it in a couple of weeks. I am quite sure my methods are not the quickest but they are consistant and work for me. I changed from scale -1 to flip because I always seemed to have placed the object such that I needed to move after scale -1
Keith
That was how I had worked in the previous CAD pgm. I would use my New Part and would enter length,width,thickness and name and get a component drawn at 0,0,0 on the layer I wanted it and already named. What I also liked was that I then knew the local axis of the part and flip was easy and placing texture also consistant. Using the key rotate plugin made rotating and placing in place fairly simple. However the Board plugin convinced me to try in place modeling again and except for the local axis I liked it. I am still working on my methods but basicly my steps are.
This seems to work well for me.
Keith
I have used the board plugin and really liked it. I have to date resisted drawing parts (boards) in place and used a newpart.rb that I modified from the box.rb sample. However the board plugin changed the way I now model and for the better. I wrote 2 plugins that work with the board plugin and extend its usefullness (in my opinion). The plugin "BoardToLayer.rb lets you rename the board compnent (or accept the existing name) and place it on a new layer of the same or user entered name then make the layer visible in a scene named "Assembly". If the scene does not exist the program will create it the first time it runs. You access the plugin with a right click on a component and select "Board/Comp to New Layer" from the drop down.
The other plugin BoardToLayerK2.rb is simular except it uses layer names with my format of "A00-" prefix in front of the component name (A for assembly, 01 to 99 a layer number to keep layers in order of when they were made). There is no option in this version for the user to alter the layer name or format.
KeithBoardToLayerK2.rb
Simple question but I cant find how to retreive the results from a message box.
UI.messagebox "Yes - Use Exiting Layer; No - Change Layer name", MB_YESNO
I have tried several ways but no sucess. Documentation is very vague for this process!!
Keith
I found the solution to the page name question.
# Add page named Assembly if not already added
pagename=[]
pgAssy = "no"
pages.each {|p|
pagename = p.name
if pagename == "Assembly"
pgAssy = "yes"
end }#if and each loop
if pgAssy == "no"
pages.add "Assembly"
end#if
thanks for looking
Keith
working on new plugin and I need to check the Text name of each existing page and this code does not work or give an error message. How should it be written?
model = Sketchup.active_model
selection = model.selection
pages = model.pages
pages.each {|name= page.name| UI.messagebox name}
Thanks Keith
Thanks that fixed the problem. I will look at the graphics drivers also
Keith
I am running SU7 on a new Dell portable win7home and now I have no selection window. In the select mode when I press the mouse button to get the selection window nothing happens. Any ideas of what the problem is?
Keith
I added .name (Sketchup.active_model.selection[0].layer.name) and got exactly what I needed.
Thanks
Keith
If I select a component and then start a script how can I find out what layer the selected component is on? I have looked at the ruby help and several script samples but could not find how to do this.
Keith
I am trying to move a component created in a rb file to a new layer also created by that file. This code moves the enities so they are only visible on the new layer but when I check the Info the component is still on layer0. Is there a way to define the component layer knowing the name? Or is there a way to select the component knowing the name? (As I am able to change the layer of a selected component so I could make that work.)
model = Sketchup.active_model
model.start_operation "CreateBox"
name = "WebTest"
layerno = "01"
# Create new layer for Part Assembly
layers = model.layers
newname = "A" + layerno + "-" + name
if layers[newname]
UI.messagebox("Layer \"#{newname}\" exists, exiting.")
return
end
layer = layers.add newname
pb = layer.page_behavior = LAYER_IS_HIDDEN_ON_NEW_PAGES
model.pages.each { |p| p.set_visibility( layer, false ) }
entities = model.active_entities
group = entities.add_group
entities = group.entities
pts = []
pts[0] = [0, 0, 0]
pts[1] = [10, 0, 0]
pts[2] = [10, 1, 0]
pts[3] = [0, 1, 0]
base = entities.add_face pts
width = -4if( base.normal.dot(Z_AXIS) < 0 )
# Now we can do the pushpull
base.pushpull width
# Put entities on layer named "newname"
entities.each{|e|e.layer=newname}
# Now we are done and we can end the operation
model.commit_operation
# If you want the group to be a Component try the following.
component_instance=group.to_component
component_instance.definition.name=name
model.commit_operation
Keith
TIG thanks that worked like I needed it to. Next time I'll remember to add the code brackets. I am in the process of adding features to my makepart ruby and as someone wrote the monkey see monkey do coding only goes so far.
Keith
I am trying to set a layer to be visible on one page using the code:
page = page.set_visibility layer visibility
I have put this code in the ruby console and it runs without error but the layer is not visible on the page as I expected.
model = Sketchup.active_model
entities = model.entities
selection = model.selection
layers = model.layers
pages = model.pages
page = pages["Blank Page"]
if (page)
UI.messagebox page
layername = "A01-Test"
page = page.set_visibility ["A01-Test"], [true]
else
UI.messagebox "Failure"
end
Would someone help point out the error in my code?
Keith
I will try to explain with more detail.
I hope this helps
Keith