Dear all,
i am a newbIE to sketchUP !
heRE i got this problem when i employ the ruby console in order to:
load the box.rb file which stored a very simple rectangular block into my opening sketchup file in sketchup 2022
my code is as the follows:
**SKETCHUP_CONSOLE.clear**
**# Path to the .rb file that contains the model**
**file_path = "C:/Users/hk/Desktop/box.rb"**
**# Load the .rb file and execute it**
**load file_path**
**# Get the loaded model from the global variable**
**model = $loaded_model**
**# Add the loaded model to the SketchUp active model**
**Sketchup.active_model.entities.add_instance(model, Geom::Transformation.new)**
and my box.rb content is as the follows:
**model = Sketchup.active_model**
**entities = model.entities**
**definitions = model.definitions**
**definition = definitions.add("box")**
**group = entities.add_group**
**group.name = "box"**
**group.entities.add_edges [2151.mm, 1709.mm, 1551.mm], [2151.mm, 0, 1551.mm]**
**group.entities.add_edges [0, 0, 0], [0, 0, 1551.mm]**
**group.entities.add_face [2151.mm, 1709.mm, 0], [0, 1709.mm, 0], [0, 1709.mm, 1551.mm], [2151.mm, 1709.mm, 1551.mm]**
**group.entities.add_edges [0.mm, 1709.mm, 0.mm], [2151.mm, 1709.mm, 0.mm]**
**group.entities.add_edges [0.mm, 1709.mm, 0.mm], [0.mm, 1709.mm, 1551.mm]**
**group.entities.add_edges [0.mm, 1709.mm, 1551.mm], [2151.mm, 1709.mm, 1551.mm]**
**group.entities.add_edges [2151.mm, 1709.mm, 0.mm], [2151.mm, 1709.mm, 1551.mm]**
**group.entities.add_face [2151.mm, 0.mm, 0.mm], [2151.mm, 1709.mm, 0.mm], [2151.mm, 1709.mm, 1551.mm], [2151.mm, 0.mm, 1551.mm]**
**group.entities.add_edges [2151.mm, 1709.mm, 0.mm], [2151.mm, 0.mm, 0.mm]**
**group.entities.add_edges [2151.mm, 0.mm, 0.mm], [2151.mm, 0.mm, 1551.mm]**
**group.entities.add_face [0.mm, 0.mm, 0.mm], [2151.mm, 0.mm, 0.mm], [2151.mm, 0.mm, 1551.mm], [0.mm, 0.mm, 1551.mm]**
**group.entities.add_edges [2151.mm, 0.mm, 0.mm], [0.mm, 0.mm, 0.mm]**
**group.entities.add_edges [2151.mm, 0.mm, 1551.mm], [0.mm, 0.mm, 1551.mm]**
**group.entities.add_edges [0.mm, 0.mm, 1551.mm], [0.mm, 1709.mm, 1551.mm]**
**group.entities.add_face [0.mm, 1709.mm, 0.mm], [0.mm, 0.mm, 0.mm], [0.mm, 0.mm, 1551.mm], [0.mm, 1709.mm, 1551.mm]**
**group.entities.add_edges [0.mm, 0.mm, 0.mm], [0.mm, 1709.mm, 0.mm]**
**group.entities.add_face [0.mm, 0.mm, 1551.mm], [2151.mm, 0.mm, 1551.mm], [2151.mm, 1709.mm, 1551.mm], [0.mm, 1709.mm, 1551.mm]**
**group.entities.add_face [2151.mm, 0.mm, 0.mm], [0.mm, 0.mm, 0.mm], [0.mm, 1709.mm, 0.mm], [2151.mm, 1709.mm, 0.mm]**
and i got the following output in my ruby console, but i can still load the box.rb into my opening .skp file and i saw my box created before
what should i do ? please help !!!
regards,
ivYYvi