Thank you all for your help.
Latest posts made by MeAd
-
RE: Creating SketchUp scene from saved files using Ruby script
-
RE: Creating SketchUp scene from saved files using Ruby script
Thanks Thomas. As you suggested, I used the model.save status to see if it is saved correctly and I found out that it was not. Somehow I saw unintentional character in the command and removed it. Now, everything is working.
Now, whenever I run the ruby script from the command line, it automatically save it as .skp. However, every time I run the ruby script, it opens a new SketchUp GUI, which i am not fond of since I am creating many models. My very last question, is it possible to perform the task without opening any SketchUp GUI?
Thanks a bunch Thomas.
-
RE: Creating SketchUp scene from saved files using Ruby script
Hello Thomthom,
Thanks for your prompt response. Just to clarify my previous question:
@thomthom said:
Do you actually mean Scene here - as in the saved views you have in SketchUp - or simply model (which is what your code indicate).
I just meant simply model.@thomthom said:
Are you sure you have the correct path? 'C:/Desktop' - do you really have a folder of that name?
Yes, I have the folder. In fact,I tried to save it in many folders and I could not locate it in any of the folders. -
RE: Creating SketchUp scene from saved files using Ruby script
Thanks Thomthom. It works perfectly. One last question, can you save the new scene automatically (if possible without showing the SketchUp GUI)?
I used the following command and I even could not locate the file.
` model=Sketchup.active_model
definition=model.definitions.load('sofa.skp')
tr= Geom::Transformation.translation [0, 0, 0]
model.active_entities.add_instance(definition,tr)
definition1=model.definitions.load('table.skp')
tr1= Geom::Transformation.translation [0, 0, 0]
model.active_entities.add_instance(definition1,tr1)Sketchup.active_model.save "c:/Desktop/room.skp"`
-
Creating SketchUp scene from saved files using Ruby script
Dear All,
I want to create a sketchup file by automatically populating with locally saved 3D sketchup models using ruby script executed from command line. I also want to apply a transformation (rotation + translation) on each of the imported models and finally save the sketchup file. For example, I created two files: 'sofa.skp' and 'table.skp'. I want to load these files onto a new file 'room.skp' after rotating and translating these objects in ruby script. Any ideas?
I tried to use model.import command (using COLLADA object files as shown below) but it requires a mouse click on SketchUp GUI to place the individual objects that makes it tedious considering the fact that the number of individual models as well as the need for automation. Thank you for your help.
model = Sketchup.active_model
model.import "file1.dae"