sketchucation logo sketchucation
    • Login
    Oops, your profile's looking a bit empty! To help us tailor your experience, please fill in key details like your SketchUp version, skill level, operating system, and more. Update and save your info on your profile page today!
    🫛 Lightbeans Update | Metallic and Roughness auto-applied in SketchUp 2025+ Download

    Taking content from arrays to open a .3ds file

    Scheduled Pinned Locked Moved Developers' Forum
    2 Posts 2 Posters 242 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.
    • B Offline
      borg.stef
      last edited by

      This is part of my program. what it is intented to do is get the first line of a txt file which is saved in a[0]. this will be the name of a .3ds model which than has to be imported in sketchup, but to do so, .3ds has to be added to the name. Something is wrong with my code I know it's something in the first line shown but I can't figure how to write it
      correctly.

      machine = "a[0].3ds"
      model = Sketchup.active_model
      show_summary = true
      status = model.import machine, show_summary

      Thanks

      1 Reply Last reply Reply Quote 0
      • TIGT Offline
        TIG Moderator
        last edited by

        Your
        machine = "a[0].3ds"
        Is simply a string - with no reference to array 'a' at all.
        machine = a[0].to_s+".3ds"
        Takes the value of the first item in the array 'a' and adds .3ds onto the end of that all as a string...
        If you are sure the first item in the array 'a' is a string you don't need the .to_s part a[0]+".3ds" will do...

        TIG

        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