sketchucation logo sketchucation
    • Login
    πŸ€‘ SketchPlus 1.3 | 44 Tools for $15 until June 20th Buy Now

    Question-How to link model components and generate on edges

    Scheduled Pinned Locked Moved Developers' Forum
    5 Posts 3 Posters 147 Views 3 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • pingpinkP Offline
      pingpink
      last edited by

      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


      Program Idea

      1 Reply Last reply Reply Quote 0
      • thomthomT Offline
        thomthom
        last edited by

        RectangularFrame_location = Sketchup.active_model.definitions.load("C:\rec.skp")

        Definition.load returns a new ComponentDefinition - 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 )

        Thomas Thomassen β€” SketchUp Monkey & Coding addict
        List of my plugins and link to the CookieWare fund

        1 Reply Last reply Reply Quote 0
        • sdmitchS Offline
          sdmitch
          last edited by

          Sounds more like a job for Profile Builder than importing components. If you truly want
          @unknownuser said:

          Aluminium Profiles to run on edges

          Nothing is worthless, it can always be used as a bad example.

          http://sdmitch.blogspot.com/

          1 Reply Last reply Reply Quote 0
          • thomthomT Offline
            thomthom
            last edited by

            @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

            Thomas Thomassen β€” SketchUp Monkey & Coding addict
            List of my plugins and link to the CookieWare fund

            1 Reply Last reply Reply Quote 0
            • pingpinkP Offline
              pingpink
              last edited by

              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

              1 Reply Last reply Reply Quote 0
              • 1 / 1
              • First post
                Last post
              Buy SketchPlus
              Buy SUbD
              Buy WrapR
              Buy eBook
              Buy Modelur
              Buy Vertex Tools
              Buy SketchCuisine
              Buy FormFonts

              Advertisement