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

    Why is 2013 breaking this plugin?

    Scheduled Pinned Locked Moved Developers' Forum
    4 Posts 4 Posters 328 Views 4 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.
    • D Offline
      doernbrackc
      last edited by

      I wrote a very simple plugin for SketchUp 8 which no longer seems to work with 2013. Is there something different or new that I need to add into the ruby code? Below is my simple code which takes every line in an Autocad file and breaks out the end points. Nothing complicated.

      require "sketchup.rb" 
      
      module CD 
      
      def self.export_points
       
      model = Sketchup.active_model 
      ents = model.active_entities 
      path = UI.openpanel() 
      
      if not path then return end 
      
      aFile = File.new(path, "w") 
      
      ents.each{|e| 
      if e.is_a?(Sketchup;;Edge) 
      sp = e.start		 #starting point of the line
      ep = e.end		 #ending point of the line
      x1 = sp.position.x
      y1 = sp.position.y 
      x2 = ep.position.x 
      y2 = ep.position.y 
      aFile.puts(x1.to_s().chop + " " + y1.to_s().chop) 
      aFile.puts(x2.to_s().chop + " " + y2.to_s().chop) 
      aFile.puts(" ") 
      end 
      } 
      
      aFile.close() 
      UI.messagebox('Script Complete') 
      
      end # CD.export_points 
      
      end # MODULE 
      
      filename = File.basename(__FILE__) 
        if not file_loaded?(filename) 
        UI.menu("Plugins").add_item("ExportWalls") {CD.export_points} 
        file_loaded(filename) 
      end
      
      1 Reply Last reply Reply Quote 0
      • Chris FullmerC Offline
        Chris Fullmer
        last edited by

        What kind of errors do you get in the ruby console?

        Lately you've been tan, suspicious for the winter.
        All my Plugins I've written

        1 Reply Last reply Reply Quote 0
        • D Offline
          driven
          last edited by

          hi

          it works on my mac...

          you need to fill in your details, so we know what os etc... your using.

          also use a code block to add your code to the message.

          you may be having permission issues, but I don't even know which platform your using.

          john

          learn from the mistakes of others, you may not live long enough to make them all yourself...

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

            What is breaking? What is expected behaviour?

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

            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