Question-How to link model components and generate on edges
-
I'm trying to write a ruby code to generate a component of Aluminium Profiles
which there are many types. My idea is undertaking to link the provided components
to run on edges and make a group of each component , then apply the material automatically.But,I can't find the method to do it. I would be very thoughtful to receive the suggestion.Below is the code that do not know how to revise it.
RectangularFrame_location = Sketchup.active_model.definitions.load("C:\rec.skp")
transform = Geom::Transformation.new RectangularFrame_location
entities = Sketchup.active_model.active_entities
instance = entities.add_instance RectangularFrame_location, transform
-
RectangularFrame_location = Sketchup.active_model.definitions.load("C:\rec.skp")
Definition.load
returns a newComponentDefinition
- not a position.And don't start varalbes with a capital letterse - that creates a constant instead.
definition = Sketchup.active_model.definitions.load("C:\rec.skp") position = Geom::Position.new( 0, 0, 0 ) # Where ever you want it transform = Geom::Transformation.new( position ) entities = Sketchup.active_model.active_entities instance = entities.add_instance( definition, transform )
-
Sounds more like a job for Profile Builder than importing components. If you truly want
@unknownuser said:Aluminium Profiles to run on edges
-
@sdmitch said:
Sounds more like a job for Profile Builder than importing components. If you truly want
@unknownuser said:Aluminium Profiles to run on edges
+1
-
Hi ,
I tried to adapt from the comment in my code , but it doesn't work yet for clicking lines then load external reference component (0,0,0) from component's file. I'm still finding how to link between the functions that the model can stretch or scales the component to the length as the edges. Here's my attached ruby , not sure what's error in the code as I'm a new to ruby ! Any suggestion , I would be appreciate!.
Thanks
Advertisement