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

[Plugin] Dxf_In v2.2 20110517 Dxf2Skp

Scheduled Pinned Locked Moved Plugins
200 Posts 41 Posters 269.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.
  • J Offline
    jgt1942
    last edited by 19 Mar 2015, 19:21

    Error loading plugin with SketchUp 2015 as follows
    Error Loading File Dxf_In_v2.2.rb
    Error: #<SyntaxError: C:/Users/John/AppData/Roaming/SketchUp/SketchUp 2015/SketchUp/Plugins/Dxf_In_v2.2.rb:306: formal argument cannot be an instance variable
    ramFile.each do |@line| #search for entities @line by @line

                          ^>
    

    I don't know if it is something I have done wrong or there is an issue with SketchUp 2015. As I looked into the issue I discovered that I had several different versions of SketchUp installed. It seems that the SketchUp developers are not smart enough to remove an older version when installing a newer version. Thus I manually uninstalled all early versions I could find and I think I now only have SketchUp 2015 installed.

    The next chore was do find where the plugins are located, scanning my system I found the location to be C:\Users\John\AppData\Roaming\SketchUp\SketchUp 2015\SketchUp\Plugins thus I copied the Dxf_In_v2.2.rb file to this location. Now when I start SketchUp 2015 I get the above error for this extension. Any suggestions? I'm attempting to import some AutoCAD dxf files.

    jgt

    1 Reply Last reply Reply Quote 0
    • D Offline
      Dave R
      last edited by 19 Mar 2015, 19:38

      @jgt1942 said:

      It seems that the SketchUp developers are not smart enough to remove an older version when installing a newer version.

      Well, you got that wrong. 😒

      They intentionally have SketchUp designed so each version installs separately and doesn't touch the older version. Many people go back and forth between versions, especiallwhen they first install a new version. There's comfort in having something to fall back on if needed. there was certainly no need to uninstall earlier versions. They didn't have anything to do with the error message you have from the plugin trying to load.

      Which version of SketchUp 2015 do you have?

      Etaoin Shrdlu

      %

      (THERE'S NO PLACE LIKE)

      G28 X0.0 Y0.0 Z0.0

      M30

      %

      1 Reply Last reply Reply Quote 0
      • D Offline
        driven
        last edited by 19 Mar 2015, 21:04

        as this plugin doesn't work in v2015, you could import into v8, and then, after saving, open in v2015 [ unless you uninstalled v8 for some misguided reason!!! ]...

        or you can change the line that's failing and see what comes next...
        this is the failing line...

        ramFile.each do |@line|	#search for entities @line by @line
        

        it's failing because it uses @ where it no longer works...
        so, replace that line :306 in the file
        C:/Users/John/AppData/Roaming/SketchUp/SketchUp 2015/SketchUp/Plugins/Dxf_In_v2.2.rb
        in with

        ramFile.each do |line|	#search for entities line by line
        

        save
        and try again...
        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
        • A Offline
          abbis
          last edited by 6 Jan 2016, 11:28

          Hi

          I am a serious beginner with sketchup, attempting to bring in a .dxf file that have been exported from QGIS. the file is clipped and not big in size (184kb)

          I am working on a mac, in sketchup make 2014, I downloaded the Dxf_in 2.2 and get this error when I start up my sketchup (see attached)

          Any advice on what may be wrong.

          I have tried to just open a .dxf file through File: Import: <select *dwg /*dxf> file type, but I get an import error(see attached).

          Any assistance would be greatly appreciated


          error starting up sketchup for both v2.0 and 2.2 of Dxf_in


          Import failed when importing a dxf file

          1 Reply Last reply Reply Quote 0
          • D Offline
            driven
            last edited by 6 Jan 2016, 21:38

            the answer is in the post above yours...

            or you could use Jim Foltz's FreeDxf plugin in the Plugin Store...

            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
            • A Offline
              abbis
              last edited by 7 Jan 2016, 06:53

              Thanks!
              I managed to sort out the first error with your comment above...
              I have now tried to deal with thesketchUp error <empty file> issue with an earlier post (see insert below):

              Find the following bit of code in the.rb file

              #get all block names, save them along with their location
              begin
              aFile=File.open(chosen_file, "r")
              rescue
              result=UI.messagebox "<Error> The DriveName\Path\FileName.dxf may not\nbe standard ASCII characters. If so, place the Dxf file\nin a ASCII named folder before accessing that file.", MB_OK
              end
              aFile.each_line do |line|
              count=count +1
              if count==odd_number #strip dxf tags thanks to TIG
              odd_number=odd_number + 2
              line=line.strip
              end

              last_line=this_line #save last line data
              this_line=line

              and insert the line
              line=line.chomp+"\n"
              after
              aFile.each_line do |line|
              it should ensure that all the data read in is terminated in a way that ruby scripts accept, and it shouldn't affect the way they run under windows either.

              But I am still getting the <empty file> error.
              Any suggestions on this?


              dxf file I am attempting to open


              Sketchup error

              1 Reply Last reply Reply Quote 0
              • D Offline
                Dave R
                last edited by 7 Jan 2016, 12:17

                I tried opening your file in SU2016 Pro. I didn't get the error message but there was nothing there after the import. The message after import indicates 674 hatches and 1 empty block that were ignored. Maybe you need to try importing a known good file and see how you manage with that. And then go back to the source of this DXF file and see if you can get a good one.

                Etaoin Shrdlu

                %

                (THERE'S NO PLACE LIKE)

                G28 X0.0 Y0.0 Z0.0

                M30

                %

                1 Reply Last reply Reply Quote 0
                • BepB Offline
                  Bep
                  last edited by 7 Jan 2016, 20:47

                  Open the dxf file in a cad program.
                  Explode all elements to get rid of the fill-in, so only the outline lines of the elements remain.
                  Now save again as dxf.
                  Import the dxf in sketchup.
                  Use the plugin "make faces" to fill-in the elements with faces.
                  Rescale if necessary.

                  "History is written by the winners"

                  1 Reply Last reply Reply Quote 0
                  • A Offline
                    abbis
                    last edited by 8 Jan 2016, 07:38

                    Thanks for all the responses,

                    I really appreciate the input!
                    I did a conversion in my GIS program to eliminate that hatches and have a .dxf file that is now just lines. It opens fine in CAD (using AutoCADLT2011). I tried exploding the lines and still that did not work.
                    It also opens fine in Illustrator...

                    I still cannot open it in SketchUp, I still get the <error> Empty File.

                    Attached .dxf file.

                    I have both the Dxf_in (I get empty file error)
                    and FreeDXF Importer v0.11.1 installed. (nothing happens / or get the parsing file indicated at the bottom of the screen)

                    Is it possible that having two plugin's is causing an issue?
                    Possibly a version of the plugin issue?

                    Maybe the way I edited the code in my message above is incorrect?

                    I Inserted
                    "line=line.chomp+"\n"
                    after
                    aFile.each_line do |line|

                    on a new line

                    in the dxf_in.rb code.

                    Thanks!


                    Dxf file... Hatches removed.

                    1 Reply Last reply Reply Quote 0
                    • J Offline
                      Jim
                      last edited by 8 Jan 2016, 08:33

                      This is what I get when importing with FreeDXF on Windows. Is this what you expect?
                      2016-01_353.png


                      Untitled.skp

                      Hi

                      1 Reply Last reply Reply Quote 0
                      • A Offline
                        abbis
                        last edited by 8 Jan 2016, 09:10

                        Yes,

                        That's exactly what I expect, just not working on my side.

                        1 Reply Last reply Reply Quote 0
                        • TIGT Offline
                          TIG Moderator
                          last edited by 8 Jan 2016, 20:07

                          What are you expecting ?
                          It's a collection of edges inside nested containers.
                          It you expect them to have faces, then you need to add them...

                          There are several ways to do this...
                          What is your desired outcome ??

                          If you expect something like this image, then making a giant rectangle ['reversed' in the attached image for clarity] under the imported object, selecting and intersecting it and waiting a few seconds, is all you need to do...


                          Capture.PNG

                          TIG

                          1 Reply Last reply Reply Quote 0
                          • A Offline
                            abbis
                            last edited by 12 Jan 2016, 13:48

                            I am expecting to be able to open my .dxf file.

                            I try to import it via Free .dxf or Dxf_in and I have no success. (see my above posts)

                            Once the file is in sketch up I can figure my way around the face/ vs edges issue. However, at this stage I am really trying to get some assistance as to what may be wrong with my sketchup / plug-ins such that I am unable to open my .dxf file.

                            Many Thanks,

                            1 Reply Last reply Reply Quote 0
                            • TIGT Offline
                              TIG Moderator
                              last edited by 12 Jan 2016, 14:16

                              You wording is still unclear.

                              You attached a SKP.

                              You spoke of 'importing' the DXF.
                              This looked like you has imported - it's in your SKP.
                              It was all lines, with no faces.
                              Since you did not provide the DXF we'll never know if that had any faces in it.
                              However, adding faces to planar edges is simple enough in SketchUp...

                              You then talk about 'opening' the DXF.
                              A DXF opens in a CAD program.
                              What are you using ?
                              SketchUp can only 'import' non-SKP files...

                              You need to get a free CAD program to open DXFs - there are several...
                              Use a Google search...

                              This thread covers an old plugin Dxf_in [it's 5 years ago!]
                              FreeDXF by Jim is much newer and works well with ASCII DXFs.
                              http://sketchucation.com/pluginstore?pln=freedfx
                              Why aren't you posting in its thread?
                              http://sketchucation.com/forums/viewtopic.php?p=186621#p186621
                              Have you looked at the PluginStore ?
                              http://sketchucation.com/plugin/838-freedfx

                              TIG

                              1 Reply Last reply Reply Quote 0
                              • A Offline
                                abbis
                                last edited by 13 Jan 2016, 07:05

                                Appologies for the wording... That was un-intentional. I didnt realise people would get confused. If you refer to the full thread you will see that I am struggling to import into SKP. (I can succesfully open my .dxf in both CAD and vector programs such as Adobe Illustrator)

                                I provided my .dxf file in an earlier post. It looks as though the user Jim could import the file successfully into sketch-up. Hence my post saying that is what I was expecting.
                                I didn't attach the SKP file that the user Jim.

                                I am unable to import my dxf (see attached again) into SKP Make 2014, working on a Mac. I was trying to resolve this issue by trying first Dxf_In and then the Free Dxf plug-in.

                                I get the error (see attached text below) in my ruby consol, when I try and import my .dxf file using Free Dxf.

                                Error: #<Errno::ENOENT: No such file or directory - /volumes/projects/x training/buildinglines_saveas.dxf>
                                /Users/abbijoustra/Library/Application Support/SketchUp 2014/SketchUp/Plugins/jf-FreeDXF/dxf2ruby.rb:54:in initialize' /Users/abbijoustra/Library/Application Support/SketchUp 2014/SketchUp/Plugins/jf-FreeDXF/dxf2ruby.rb:54:in open'
                                /Users/abbijoustra/Library/Application Support/SketchUp 2014/SketchUp/Plugins/jf-FreeDXF/dxf2ruby.rb:54:in parse' /Users/abbijoustra/Library/Application Support/SketchUp 2014/SketchUp/Plugins/jf-FreeDXF/freedxf.rb:252:in import'
                                /Users/abbijoustra/Library/Application Support/SketchUp 2014/SketchUp/Plugins/jf-FreeDXF/freedxf.rb:219:in do_import' /Users/abbijoustra/Library/Application Support/SketchUp 2014/SketchUp/Plugins/jf-FreeDXF/freedxf.rb:112:in block in do_options'
                                /Users/abbijoustra/Library/Application Support/SketchUp 2014/SketchUp/Plugins/jf-FreeDXF/SKUI/events.rb:82:in call' /Users/abbijoustra/Library/Application Support/SketchUp 2014/SketchUp/Plugins/jf-FreeDXF/SKUI/events.rb:82:in block in trigger_event'
                                /Users/abbijoustra/Library/Application Support/SketchUp 2014/SketchUp/Plugins/jf-FreeDXF/SKUI/events.rb:78:in each' /Users/abbijoustra/Library/Application Support/SketchUp 2014/SketchUp/Plugins/jf-FreeDXF/SKUI/events.rb:78:in trigger_event'
                                /Users/abbijoustra/Library/Application Support/SketchUp 2014/SketchUp/Plugins/jf-FreeDXF/SKUI/window.rb:357:in event_control_callback' /Users/abbijoustra/Library/Application Support/SketchUp 2014/SketchUp/Plugins/jf-FreeDXF/SKUI/window.rb:311:in callback_handler'
                                /Users/abbijoustra/Library/Application Support/SketchUp 2014/SketchUp/Plugins/jf-FreeDXF/SKUI/window.rb:269:in block in add_callback' -e:1:in call'

                                Whereas with the Dxf_in I recieved and error <empty file> in SKP.

                                This is the first time I am engaging with any time of forum such as this so I appologise if I have post in an incorrect thread....!
                                I appreciate your input TIG - I am just trying to figure this issue out with whatever assistance I can get.

                                Many Thanks


                                The .dxf file I am attempting to import

                                1 Reply Last reply Reply Quote 0
                                • h_coa7H Offline
                                  h_coa7
                                  last edited by 10 Feb 2018, 15:18

                                  @charly2008 said:

                                  Hi honoluludesktop,

                                  I wanted to try it once but I can't find it in the Plugins menu!

                                  Charly

                                  Hello
                                  In which folder did you copy the sketch?

                                  1 Reply Last reply Reply Quote 0
                                  • B Offline
                                    BitzBlitz
                                    last edited by 24 Mar 2018, 23:37

                                    I'm trying to use this plugin in SketchUp Make 17.2.2555 and I see this when SkecthUp starts:
                                    Error Loading File Dxf_In_v2.2.rb
                                    Error: #<SyntaxError: C:/Users/bitzb/AppData/Roaming/SketchUp/SketchUp 2017/SketchUp/Plugins/Dxf_In_v2.2.rb:306: formal argument cannot be an instance variable
                                    ramFile.each do |@line| #search for entities @line by @line

                                                          ^>
                                    

                                    Is there anyway to fix this?

                                    1 Reply Last reply Reply Quote 0
                                    • TIGT Offline
                                      TIG Moderator
                                      last edited by 25 Mar 2018, 17:13

                                      It's a very old, no longer supported script.

                                      But, for personal use you could try an edit.
                                      Open the RB file referred to in the error message[s].
                                      Find do|@line| block.
                                      Immediately BEFORE that:
                                      @line=nil
                                      Now remove the @ from its start, so it is then just do|line| ...
                                      Then add a new line immediately AFTER that:
                                      @line=line
                                      This way the instance variable @line is set up outside of the block, for use in other methods, but it is not used directly as the iterator of the block, and now it is simply referenced to it - using a @ is no longer allowed in newer Ruby versions...

                                      TIG

                                      1 Reply Last reply Reply Quote 0
                                      • M Offline
                                        masterlaws
                                        last edited by 28 Mar 2020, 05:39

                                        In case it's useful to anyone else, here's the modifications per TIG's instructions above. I've bumped the version from 2.2 to 2.3. Thanks TIG


                                        Dxf_In_v2.3.rbz

                                        1 Reply Last reply Reply Quote 0
                                        • D Offline
                                          dlongaggie65
                                          last edited by 25 Feb 2021, 22:38

                                          Thanks, masterlaws! I followed the modification using "vi" on my Mac and didn't see the updated version until after I had it working.

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

                                          Advertisement