Thanks for the answer!
If I have to make the texturing procedure automatically, may be in one way: using Magick++ to produce DLLs, then using Ruby script in SU to call them. At least am trying to do so...
Thanks for the answer!
If I have to make the texturing procedure automatically, may be in one way: using Magick++ to produce DLLs, then using Ruby script in SU to call them. At least am trying to do so...
hm, let me try to figure out :
vinc.
Hi,
have polygon from Sketchup model, and want cut the corresponding parts of images which saved on my harddisk. Have tried RMagick, it works ok with ruby, but doesn't work in the Sketchup: require 'RMagick' ->false
My question is: what is the easy way to do that?
vinc.
Thank you very much!!
Thank you Didier! Your codes work perfect!
One small question:
why there are many symbol ~ in the results:
...
x: ~ -68102,27m y: 214820,00m z: 349,82m
x: -68101,73m y: ~ 214828,80m z: 349,82m
x: ~ -68102,68m y: ~ 214813,19m z: 349,82m
...
vinc.
have imported the dxf file and exported it again in dxf, the coordinates of exported file are in local model system. Difficult imagine Sketchup lost the original coordinates!
Or have done something wrong?
vinc.
Thank you Gaieus for the quick answer!
Yes the dxf file is georeferenced, we have here one vertex as example:
VERTEX
5
AB
330
A1
100
AcDbEntity
8
36456188
100
AcDbVertex
100
AcDb3dPolylineVertex
10
-68005.41899999999
20
214842.715
30
373.85
70
32
0
where I the two original coordinates should be -68005 214842 373. And I use following code I wrote:
#---------------------------------------
model=Sketchup.active_model # point to the active model
entities = model.entities # get the selected entities
puts entities.length # see how many entities in model
i=0
Ausgabe = File.new("C:/list.txt","w")
entities.each {|entity|
if (entity.kind_of? Sketchup::Face)
i=i+1
vertices = entity.vertices
length = vertices.length
puts length
for j in 0...length
vertex = vertices[j]
point = vertex.position
xc = point.to_a
strx = xc.x.to_s
stry = xc.y.to_s
strz = xc.z.to_s
strmess = sprintf("x: %s y: %s z: %s \n", strx, stry, strz)
puts strmess
Ausgabe.syswrite(strmess)
end
end
}
puts "Alltogether "+i.to_s+" faces"
#-------------------------------------------------------------------
and see lots of coordinates in the produced file like these:
x: 1674.70131904589 y: 5984.79975691969 z: 968.425196850396
x: 1737.61470487252 y: 5947.2407018018 z: 922.36220472441
x: 1840.37061038431 y: 5978.57928447771 z: 924.330708661419
......
any idea?
vinc.
Hi,
newbie for ruby...
I have imported Dxf(dwg) file in Sketchup Pro 6 and wanted use Ruby script to find out the corners original coordinates (not local model coordinates) of each face in the model, is that possible? Is there any example to do the similar?
thanks!
vinc.
hi,
downloaded the zip file and unzipped but cloud_v6.rb seems packed, can not be read, what is wrong?
vinc.