• Login
sketchucation logo sketchucation
  • Login
⚠️ Libfredo 15.4b | Minor release with bugfixes and improvements Update

How can import and locate the components by ruby script?

Scheduled Pinned Locked Moved Developers' Forum
4 Posts 2 Posters 1.2k Views 2 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.
  • W Offline
    winzard
    last edited by 9 Jun 2009, 11:01

    Everyboby ,I want to have the method relating to import and location of the components.Please give me help .Thanks!

    1 Reply Last reply Reply Quote 0
    • T Offline
      thomthom
      last edited by 9 Jun 2009, 11:08

      Use the .load or .load_from_url methods from the DefinitionList to import components to the model. http://code.google.com/intl/nb/apis/sketchup/docs/ourdoc/definitionlist.html

      Depending how you want to add the component, use either entities.add_instance http://code.google.com/intl/nb/apis/sketchup/docs/ourdoc/entities.html#add_instance or model.place_component http://code.google.com/intl/nb/apis/sketchup/docs/ourdoc/model.html#place_component

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

      1 Reply Last reply Reply Quote 0
      • T Offline
        thomthom
        last edited by 9 Jun 2009, 11:09

        If you want to get the path a component was loaded from use the .pathmethod for the definition. http://code.google.com/intl/nb/apis/sketchup/docs/ourdoc/componentdefinition.html#path

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

        1 Reply Last reply Reply Quote 0
        • W Offline
          winzard
          last edited by 9 Jun 2009, 14:50

          The information is vrey important .And I want to import some components into coordinates by ruby scripts and locate the components by parameter form the user,What methods need to refer? Please give me some suggestions.Thanks!

          The size of components add a lot of difficulties,because space of the components need to taken in my ruby script.Now ,I have trouble to deal with that. Does some solutions be gave?
          😢

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

          Advertisement