• Login
sketchucation logo sketchucation
  • Login
🤑 SketchPlus 1.3 | 44 Tools for $15 until June 20th Buy Now

[PlugIn] 3D Printers G-Code importer/Exporter Ver0.0.9

Scheduled Pinned Locked Moved Plugins
29 Posts 13 Posters 41.7k 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.
  • D Offline
    Davidfi1
    last edited by 24 Jan 2013, 07:15

    Uploaded vertion 0.0.5.
    Include impruvment to speed and rendering

    Please let me know if you like it 😄

    1 Reply Last reply Reply Quote 0
    • D Offline
      Dan Rathbun
      last edited by 24 Jan 2013, 10:35

      Line 117:
      if (Sketchup.version_number < 7)

      should be:
      if (Sketchup.version.to_i < 7)

      Line 135:

      # wait forever
      while 1==1 do 
      end # while 1
      
      

      That is dangerous! It could lock up SketchUp if an error occurs, causing file handles to remain open.

      Use a continue messagebox instead.

      And you should return a numeric error code instead of 0 when an exception occurs.

      I'm not here much anymore.

      1 Reply Last reply Reply Quote 0
      • D Offline
        Dan Rathbun
        last edited by 24 Jan 2013, 10:43

        @davidfi1 said:

        Uploaded vertion 0.0.5.
        Include improvment to speed and rendering

        Just so you know...

        The native Ruby Console, is not actually a "true console interface".
        It is really a dialog with a non-editable multi-line text control.
        Writing output to the text control is VERY slow, and gets SLOWER the more that is written.

        (*) Write only what you NEED to.
        OR ...
        Perhaps write output to a log file instead, and after the import, display the log file's text in a Webdialog frame. (The browser can display plain text files.)

        I'm not here much anymore.

        1 Reply Last reply Reply Quote 0
        • D Offline
          Davidfi1
          last edited by 24 Jan 2013, 19:24

          Dan.
          Thank you, you are very helpfull.
          I don't really know what to do with these errors in the G-Code I am getting.
          It is not even correct to say they are errors at all.
          I use the ruby console as a very simple "information console"
          There is nothing to do with these "errors" just know about them...

          If somone don't want to see these messages he could just close the console.

          In the following versions I will not open the ruby console at all.

          Thank you again.
          David.

          1 Reply Last reply Reply Quote 0
          • D Offline
            Davidfi1
            last edited by 24 Jan 2013, 19:29

            @dan rathbun said:

            Line 117:
            Line 135:

            # wait forever
            > while 1==1 do 
            > end # while 1
            > 
            

            That is dangerous! It could lock up SketchUp if an error occurs, causing file handles to remain open.

            will do.
            Thank you.

            1 Reply Last reply Reply Quote 0
            • D Offline
              Davidfi1
              last edited by 27 Jan 2013, 13:46

              New Version 0.0.6 posted
              Thank you.

              1 Reply Last reply Reply Quote 0
              • A Offline
                antoninoion
                last edited by 2 Feb 2013, 03:10

                I'm getting the following error in the ruby console every time I start SU and it doesn’t show the G-code file type in the import file types list:

                GcodeImporterVer0.0.6.rb:38: warning: Object#type is deprecated; use Object#class

                I installed the plugin through the "Preferences/Extensions/Install Extension" option. I have SU V8.0.16845 for Mac, any idea on what I should do?

                Thanks
                Antonio

                1 Reply Last reply Reply Quote 0
                • D Offline
                  Davidfi1
                  last edited by 2 Feb 2013, 20:51

                  @antoninoion said:

                  I'm getting the following error in the ruby console every time I start SU and it doesn’t show the G-code file type in the import file types list:

                  GcodeImporterVer0.0.6.rb:38: warning: Object#type is deprecated; use Object#class

                  I installed the plugin through the "Preferences/Extensions/Install Extension" option. I have SU V8.0.16845 for Mac, any idea on what I should do?

                  Thanks
                  Antonio

                  I found the problem - fixing it soon.
                  change line 38 from:
                  if @ent.type == Sketchup::Edge
                  to:
                  if @ent.class == Sketchup::Edge

                  But wait for more testing - I will post a fix soon
                  Thank you.

                  1 Reply Last reply Reply Quote 0
                  • D Offline
                    Davidfi1
                    last edited by 9 Feb 2013, 19:13

                    Version 0.0.7
                    Now we have a G-Code Exporter of the previously imported G-Code in the plugin menu.
                    So I changed the name to GcodeTools ... (please delete the old one)
                    The new exporter is a very simple assuming that in the next versions will be
                    adding all the needed features to make it usable

                    • so please let me know what need's to be fixed!.
                    1 Reply Last reply Reply Quote 0
                    • D Offline
                      Davidfi1
                      last edited by 14 Feb 2013, 22:14

                      Version 0.0.8
                      Added to the exporter the ability to connect "unconnected" components
                      so now if a component is deleted - the exporter will just put a link to the
                      first component of the disconnected chain

                      1 Reply Last reply Reply Quote 0
                      • D Offline
                        Davidfi1
                        last edited by 23 Feb 2013, 18:27

                        Version 0.0.9
                        New in Importer:
                        Will put a Attribute with the value of speed from the imported G-Code in the
                        "filament" & "MotorMove" components
                        Change the Z scale of the "filament" component according to the amount of
                        extruded filament in the imported G-Code
                        New in Exporter:
                        Export to the G-Code the Attribute of speed as was imported by the importer.
                        Export the Extruded length according to the Z scale of the "filament" component

                        1 Reply Last reply Reply Quote 0
                        • D Offline
                          Davidfi1
                          last edited by 3 Mar 2013, 17:37

                          What should the next feature be?
                          If you have an idea, I will be very happy to try implementing it.

                          1 Reply Last reply Reply Quote 0
                          • J Offline
                            Jim
                            last edited by 3 Mar 2013, 17:41

                            @davidfi1 said:

                            What should the next feature be?
                            If you have an idea, I will be very happy to try implementing it.

                            Animate a model of a cnc machine from the gcode.

                            Hi

                            1 Reply Last reply Reply Quote 0
                            • D Offline
                              Davidfi1
                              last edited by 7 Mar 2013, 20:03

                              @jim said:

                              @davidfi1 said:

                              What should the next feature be?
                              If you have an idea, I will be very happy to try implementing it.

                              Animate a model of a cnc machine from the gcode.

                              Did you try to import CNC G-Code?
                              Can you explain what was the problem?
                              Do you have an idea how it should work if it was working correctly?

                              1 Reply Last reply Reply Quote 0
                              • D Offline
                                dooseyboy
                                last edited by 11 Jul 2013, 05:41

                                i have attempted this plugin in 2013, about to try it in 8 pro.
                                thought i should bring this little web app that i found recently.
                                it is a gcode viewer and i was hoping to use it to view the gcode i exported from sketchup in it but it doesn't seem to be working from being exported in 2013.
                                http://jherrm.github.io/gcode-viewer/

                                neither of the gcode files i exported from regular sketchup files worked in the simulator. but i am keen to use this addon to use the simulation app

                                1 Reply Last reply Reply Quote 0
                                • Z Offline
                                  zurits
                                  last edited by 27 Sept 2013, 22:43

                                  Does not work for me either; Sketchup 2013 Win7x86, thanks for for the code.

                                  1 Reply Last reply Reply Quote 0
                                  • M Offline
                                    mkultra
                                    last edited by 25 May 2014, 15:32

                                    2014 load fails...
                                    2014/SketchUp/Plugins/Fishelzon/GcodeImporterVer0.0.8.rb:38: formal argument cannot be an instance variable
                                    @filamentComp.entities.each { |@ent|

                                                                           ^
                                    

                                    C:/Users/Cheryl/AppData/Roaming/SketchUp/SketchUp 2014/SketchUp/Plugins/Fishelzon/GcodeImporterVer0.0.8.rb:163: formal argument cannot be an instance variable
                                    IO.foreach(filename) do |@line|

                                                                    ^
                                    

                                    C:/Users/Cheryl/AppData/Roaming/SketchUp/SketchUp 2014/SketchUp/Plugins/Fishelzon/GcodeImporterVer0.0.8.rb:183: formal argument cannot be an instance variable
                                    @params.map {|@var|

                                                            ^>
                                    

                                    C:/Program Files (x86)/SketchUp/SketchUp 2014/Tools/extensions.rb:197:in require' C:/Program Files (x86)/SketchUp/SketchUp 2014/Tools/extensions.rb:197:in load'
                                    C:/Users/Cheryl/AppData/Roaming/SketchUp/SketchUp 2014/SketchUp/Plugins/Fishelzon_GcodeTools_ext.rb:40:in register_extension' C:/Users/Cheryl/AppData/Roaming/SketchUp/SketchUp 2014/SketchUp/Plugins/Fishelzon_GcodeTools_ext.rb:40:in loadLastVer'
                                    C:/Users/Cheryl/AppData/Roaming/SketchUp/SketchUp 2014/SketchUp/Plugins/Fishelzon_GcodeTools_ext.rb:47:in <module:Fishelzon>' C:/Users/Cheryl/AppData/Roaming/SketchUp/SketchUp 2014/SketchUp/Plugins/Fishelzon_GcodeTools_ext.rb:11:in <top (required)>'

                                    1 Reply Last reply Reply Quote 0
                                    • M Offline
                                      mctabish
                                      last edited by 14 Feb 2015, 10:28

                                      I am also failing to load on start up. I get:
                                      Error Loading File C:/Users/Pop/AppData/Roaming/SketchUp/SketchUp 2014/SketchUp/Plugins/Fishelzon/GcodeImporterVer0.0.8.rb
                                      Error: #<SyntaxError: C:/Users/Pop/AppData/Roaming/SketchUp/SketchUp 2014/SketchUp/Plugins/Fishelzon/GcodeImporterVer0.0.8.rb:38: formal argument cannot be an instance variable
                                      @filamentComp.entities.each { |@ent|

                                                                             ^
                                      

                                      C:/Users/Pop/AppData/Roaming/SketchUp/SketchUp 2014/SketchUp/Plugins/Fishelzon/GcodeImporterVer0.0.8.rb:163: formal argument cannot be an instance variable
                                      IO.foreach(filename) do |@line|

                                                                      ^
                                      

                                      C:/Users/Pop/AppData/Roaming/SketchUp/SketchUp 2014/SketchUp/Plugins/Fishelzon/GcodeImporterVer0.0.8.rb:183: formal argument cannot be an instance variable
                                      @params.map {|@var|

                                                              ^>
                                      

                                      C:/Program Files (x86)/SketchUp/SketchUp 2014/Tools/extensions.rb:197:in require' C:/Program Files (x86)/SketchUp/SketchUp 2014/Tools/extensions.rb:197:in load'
                                      C:/Users/Pop/AppData/Roaming/SketchUp/SketchUp 2014/SketchUp/Plugins/Fishelzon_GcodeTools_ext.rb:40:in register_extension' C:/Users/Pop/AppData/Roaming/SketchUp/SketchUp 2014/SketchUp/Plugins/Fishelzon_GcodeTools_ext.rb:40:in loadLastVer'
                                      C:/Users/Pop/AppData/Roaming/SketchUp/SketchUp 2014/SketchUp/Plugins/Fishelzon_GcodeTools_ext.rb:47:in <module:Fishelzon>' C:/Users/Pop/AppData/Roaming/SketchUp/SketchUp 2014/SketchUp/Plugins/Fishelzon_GcodeTools_ext.rb:11:in <top (required)>'

                                      Any resolution?
                                      sketchup 2014 Win 7 x64

                                      Thanks
                                      Bruce

                                      1 Reply Last reply Reply Quote 0
                                      • D Offline
                                        Dan Rathbun
                                        last edited by 21 Feb 2015, 22:59

                                        Try making the following changes. untested

                                        (Ruby v 2.0 will not allow direct references to instance variables in the block parameter list.)

                                        Line 38:
                                        @filamentComp.entities.each { |ent| @ent = ent

                                        Line 163:
                                        IO.foreach(filename) do |line| @line = line

                                        Line 183:
                                        @params.map {|var| @var = var

                                        I'm not here much anymore.

                                        1 Reply Last reply Reply Quote 0
                                        • S Offline
                                          sparkdaddychad
                                          last edited by 17 Apr 2015, 13:06

                                          I know this is a couple of years old but the plugin does not appear to work with latest version of SKetchup Make. Any chance there is an updated version of this plugin anywhere? Would really love to import Gcode files into SKetchup.

                                          Thanks!!

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

                                          Advertisement