• Login
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
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.
  • P Offline
    pingpink
    last edited by 28 Aug 2012, 05:26

    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
    • T Offline
      thomthom
      last edited by 28 Aug 2012, 07:20

      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
      • S Offline
        sdmitch
        last edited by 4 Sept 2012, 13:46

        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
        • T Offline
          thomthom
          last edited by 4 Sept 2012, 13:56

          @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
          • P Offline
            pingpink
            last edited by 19 Dec 2013, 13:52

            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