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!
    🚨 Skimp | 25% Off until March 30 Buy Now

    The results of "line.strip"

    Scheduled Pinned Locked Moved Developers' Forum
    3 Posts 2 Posters 306 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.
    • honoluludesktopH Offline
      honoluludesktop
      last edited by

      In the following snippet, aFile is a text file, where a typical line may be line == " 10\n". When line == line.strip in order to take out the white spaces, is the resulting line == "10\n" or something else like line == "10"?

      count = 0
      odd_number = 1
      aFile.each_line do |line|
        count = count +1
        if count == odd_number
          line = line.strip
          odd_number = odd_number + 2
        end
      
        if line == "10\n"
          #do something
        end
      end
      
      1 Reply Last reply Reply Quote 0
      • thomthomT Offline
        thomthom
        last edited by

        404 Not Found

        favicon

        (ruby-doc.org)

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

        1 Reply Last reply Reply Quote 0
        • honoluludesktopH Offline
          honoluludesktop
          last edited by

          Tom, Thanks, I previous looked at that page, and tried to correct my code, but couldn't make it work. Guess it's another case where I am asking the wrong question. It's late, I will take another stab at it tomorrow. Except for speed, parsing, layers, block names, and nested blocks the plugin is (beta) usable.
          temp09.jpg
          This is a import of a Dxf file. The coding is very basic, but modular enough to add other Dxf features in the future.

          1 Reply Last reply Reply Quote 0

          Hello! It looks like you're interested in this conversation, but you don't have an account yet.

          Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

          With your input, this post could be even better πŸ’—

          Register Login
          • 1 / 1
          • First post
            Last post
          Buy SketchPlus
          Buy SUbD
          Buy WrapR
          Buy eBook
          Buy Modelur
          Buy Vertex Tools
          Buy SketchCuisine
          Buy FormFonts

          Advertisement