Thank you TIG - very much appreciate your help with this!
Sam
Posts
-
RE: Replace multiple components from library
-
RE: Replace multiple components from library
Hi TIG,
I just tried this script out on a live job and its brought back an unexpected result. I ran the script and all the components updated BUT all the updated ones now have a long string of numbers after their name?For example one component that used to be called
FURN Gilato Freezer
is now called
FURN Gilato Freezer0.2997187799735820.3522457440064450.555740003636928If the names are going to change then unfortunately I will have to go back to the drawing board and rebuild jobs manually because all of our component names are linked to a stock file database which is name and case sensitive.
Do you know why this would have happened and if its possible to keep the names the same as the original?
Thanks -
RE: Script to bring all components from library into SU model
TIG - thanks for the thorough explanation. Still coming up against some problems with the next part of the scrip but will do some further reading when I get time to see where Im going wrong. Totally new to scripting so need to try to get my head round this a bit better.
Cheers -
RE: Script to bring all components from library into SU model
Thanks dukejazz - but it still means I have to load all of the component from the component browser in the first place. I have hundreds (around 700 at last count) of components to load so am trying to find a way to load them all 'automatically' with the use of a script. I don't currently have them all in one file to copy from, they are all saved as individual components in a component library folder.
-
RE: Script to bring all components from library into SU model
Ive been having another trawl around to see if I can find away to do this and found this post which seems like the perfect starting point.
Inserting an External SketchUp Component (of some Pants)
Posted by Scott Lininger, SketchUp Software Engineer You've just SketchUped an amazing Robot Monkey , and you're ready to include him in yo...
(sketchupapi.blogspot.com)
This is the script I have been trying to get to run
pants_def = Sketchup.active_model.definitions.load("C:\pants.skp")
Sketchup.active_model.place_component(pants_def)I have changed the file path to match where I have saved the file on my computer but I keep getting the following error message if I run the script.
(eval):2537
pants_def = Sketchup.active_model.definitions.load("C:\Users\sam.morris\Desktop\pants.skp")
Error: #<IOError: (eval):2537:in `load': Invalid component file>
(eval):2537
(eval):2537Apologies for the probably being a complete noobie error on my part but Im trying to work out how to do this.
I have downloaded the two components from the post and have changed the name of the skpfile to pants to match the script. I know this post is very old (2008) and I wonder if it may be that the way ruby works has changed since then but Im stumped. It seems like a very simple code and I feel like a simpleton for not being able to get it to work.
Any advice much appreciated.
Sam -
Script to bring all components from library into SU model
Hi,
I started this post in the Sketchup forum but wonder now whether it might be better in here.
Wonder if anyone can help me to find or write a script that will allow me to bring all of the components from a component library into an SU file. Ideally I'd like to be able to place them next to each other in a line or on a grid (say 1000mm grid).
Is this possible to do? Currently Im having to manually load components and would like to find a quicker way to do it.
Thanks
Sam -
Script to bring all components from library into SU model
Hi,
Wonder if anyone can help me to find or write a script that will allow me to bring all of the components from a component library into an SU file. Ideally I'd like to be able to place them next to each other in a line or on a grid (say 1000mm grid).
Is this possible to do?
Thanks
Sam -
RE: Replace multiple components from library
TIG - truly you are a leg-end! Thanks so much!!
This has saved me hours of really boring and laborious work, thank you, thank you, thank you,
-
RE: Replace multiple components from library
Hi TIG, just tried the code and I don't seem to get a result? Sorry but wonder if you can see where Im going wrong.
Created test file and made some dummy components in this file
Went to in file in components pallet and saved as local collection
Closed test file
Opened each component file and changed colours / sizes - then saved (in same location with same name)
Re-opened test file (still displaying old un coloured components)
Pasted script into console
Components dont update to new coloured ones and got the following in console after hitting enter . . .m=Sketchup.active_model;m.start_operation('!');s=m.definitions;s.each{|d|next if !d.path;next if !File.exist?(d.path);d=s.load(d.path)};m.commit_operation
trueTried restarting SU after saving files but no dice!
Thanks in advance
-
RE: Replace multiple components from library
Gotcha - nice one TIG. Will create a dummy library and give this a go (just so I dont mess my existing library up)
Thanks!
-
Replace multiple components from library
Hi all,
Just wondering if anyone can help me. Im looking for a way to update multiple components in a file. Ive a library file saved on a network drive with several folders of components - probably around 500 components in total. I want to make some adjustments to all of these components (adding a layer and several 2d elements for drafting in Layout) and wonder if there is a way to update ALL of the components in a SU model without having to individually select each component and reload it (in the edit tab in components window).
Any help with this would be (very) much appreciated!
Thanks
Sam -
RE: [Plugin] ComponentReporter++ v1.2
Hi Tig,
Great plugin - thanks. Ive used this on several jobs now and wonder if you can help me to make a few tweaks. I've been trying to use this to count components in a selection. I know that the plugin exports 3 csv documents and was wondering if you can help me to tailor the script to get the count Im after - Im afraid Im a total noob to Ruby but am more than happy to have a play with it if you can offer a little advice.Id like to be able to generate a count for eithera whole model or for a selection within the model. I know that the script already generates a count for a selection but I'd like to be able to summarize items with the same name -giving me a total number.
I also wonder if its possible to only display the component name and the count and none of the other information (guid, description, material etc). Im trying to reduce the amount of work I need to do to tidy up the csv files that are generated.
Ive been playing with this whenever I get some spare time but would love a little advice.
Any help much appreciated.
Thanks
Sam
-
RE: More Speed!!!
Agreed, on the mac PDF import is really handy as is the spell checker! Bit of an over site / shortcoming for a "professional" app not to allow you to spell check!
The pc version is very slow and clunky by comparison. -
More Speed!!!
A major part of my wishlist would be to improve the speed of Layout - particularly on PC. I previously worked on mac and found LO could be slow but on PC it is even worse. Very unresponsive! Not sure why this is, the files Im working on aren't particularly big - even editing or formatting text in a blank document can be very slow. Would love it if LO was given a tune up on speed - its irritatingly slow at the moment.
-
RE: Layout wishlist
Agreed again - layer structures in DWG/DXF exports would be great. Perhaps as a tick box option if you are happy to increase the size / complexity of the file?
-
RE: Unlimited Zoom
Its a restriction in the program its self - bit hard to explain if you haven't used layout. On SU you can zoom to infinity (an beyond I guess) but in layout the zoom stops so you cant get any closer to what you are looking at. The amount of zooming you can do is restricted so its impossible because the application wont allow you to zoom any futher. Easier if you actually have a look at Layout and will see what people are talking about.
-
RE: Unlimited Zoom
Its the drafting application for producing drawings of sketchup models.
-
RE: Unlimited Zoom
Yup - the amount of zoom is restricted in Layout. Try it out!
-
RE: Unlimited Zoom
Yes yes - unlimited zoom PLEASE and better snapping in non vector'd views.
-
RE: Layout wishlist
More zoom and better snapping in raster mode so dims can be added accurately without switching to vector as it slows the drawing down considerably.