Moving all components to origin
-
@dennis_n said:
Is there any way to automate this process? (I'll have to perform this in the future on many models (()
DennisProbably if you would list the manual steps you are using to accomplish the result you want along with some screen shots of the before and after.
-
1 Press import
2. Pick file
3. Pick 0,0,0 as insertion point
4. repeat 176 times
-
Is this the 'before' or 'after'?
Could you post a couple of .obj files?
-
you could install a trial version of 3DS Max and run a 'batch import' script from scriptspot.com. and attach all the patches into one object. Or just have patience,- it's a 3-4 hours job +-
-
How about something like this ?
Select all of the 'containers' to be moved to the model's origin...Sketchup.active_model.selection.each{|e| pt=e.transformation.origin ve=pt.vector_to(ORIGIN) tr=Geom;;Transformation.translation(ve) e.transform!(tr) }
???
-
Error: #<NameError: uninitialized constant Transformation>
<main>:3:inblock in <main>' <main>:in
each'
<main>:in `<main>'Ruby is a foreign language to me (. It gave me an error.
Positioning to origin is a half task. another task is to import multiple files (instead of 1 by 1)
-
Sorry my typo.
I've corrected the code - please retry... -
Woo hooo!!! it works!!!
2 more questions then:
- how do I make a button out of it?
- How to import a few hundred (DAE) objects simultaneously?
-
- Make file, encoded as UTF8, named say
AAA.rb
- containing the following lines.
` module Dennis_n
cmd=UI::Command.new("AAA"){
XXX
}
cmd.tooltip='AAA...'
cmd.status_bar_text='AAA...'
cmd.small_icon=File.join(File.dirname(FILE), 'AAA-16x16.png')
cmd.large_icon=File.join(File.dirname(FILE), 'AAA-24x24.png')
toolbar=UI::Toolbar.new('AAA')
toolbar.add_item(cmd)
toolbar.restore if toolbar.get_last_state.abs==1end`
The images used for the buttons are expected to be in the same folder as the RB file.
Here they are expected to be 16 and 24 px square.
Replace theAAA
text with whatever name you want...
Add the lines of 'code' inside the command's{ }
replacingXXX
...
- Much more complicated... But it already exists !
See this... http://sketchucation.com/pluginstore?pln=import_from_folder
Usage: http://sketchucation.com/forums/viewtopic.php?p=331966#p331966
You run it from the Ruby Console - but of course a toolbar is possible using the above method...
- Make file, encoded as UTF8, named say
-
-
I feel ashamed, making a button is over my head. However, just pasting the script in to the command line, works.
-
Import does bring the files in. The script doesn't place the imported DAEs into the model. It just loads them into the memory. I can see them in my component menu but not in the moles. (during manual placement - I got to click to place the DAE in. With the script -there is no click to place it.) How to do?
-
Advertisement