Sorry,smicha wrote:Code: Select all
SU: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
It is obviously
Code: Select all
SU:
0 1 2 3
4 5 6 7
8 9 10 11
12 13 14 15
Sorry,smicha wrote:Code: Select all
SU: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
Code: Select all
SU:
0 1 2 3
4 5 6 7
8 9 10 11
12 13 14 15
Hi Smicha, congrats in reaching your goal.smicha wrote:TIG,
I DID IT !!! BUT your further help is needed
Look at screenshots.
Before running the script I moved one of the copy of components into the project origin, to make its axes overlapping axes of the project. Then selected it and type command for running the script.
The last (I hope) thing to input into your code is to make set axes of selected component equal to [0,0,0]. Is it possible?
Thank you again! So much!!!
Yes,rappet wrote:Can you explain now what exactly you can do fromout Sketchup?
greetings
I tried it and it works perfectly. This is great stuff !!!!smicha wrote:TUTORIAL - COMPONENTS TO OCTANE INSTANCES
First beta version of Sketchup plugin (ruby file) exporting components as instances to Octane
The code of instances.rb is written by TIG, I added some changes to rotation matrix. TIG - thank you so so so much!
1. Download instances.rb file into C:\Program Files (x86)\Google\Google SketchUp 8\Plugins
2. Follow steps from pdf - screenshots.
Code: Select all
module SMICHA
def SMICHA.instances()
### REST of method code goes here ###
end#method
end#module
TIG wrote:Can I suggest you wrap the working code in a 'module' and run it thus:
SMICHA.instances
The module version becomes:Code: Select all
module SMICHA def SMICHA.instances() ### REST of method code goes here ### end#method end#module
Code: Select all
module SMICHA
def SMICHA.instances()
require 'sketchup.rb'
def octane_scatter_data()
model=Sketchup.active_model
instances=model.selection[0].definition.instances
txt=""
instances.each{|instance|
tr=instance.transformation.to_a
tt=[tr[0],tr[8],-(tr[4]),tr[12].to_m, tr[2],tr[10],tr[6],tr[14].to_m, -(tr[1]),tr[9],tr[5],-(tr[13].to_m)]
str=""
tt.each{|e| str<<sprintf("%.4f ",e) }
txt<<str+"\n"
}
path=File.dirname(model.path)
file=File.join(path, model.title+"_"+instances[0].definition.name+".TXT").tr("\\","/")
f=File.new(file, "w")
f.puts(txt)
f.close
end
end#method
end#module
Code: Select all
UI.menu("PlugIns").add_item("OCTANE scatter data from components") {
UI.messagebox("......")
}