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

[Plugin] FreeDXF Importer

Scheduled Pinned Locked Moved Plugins
148 Posts 41 Posters 174.8k Views 41 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.
  • J Offline
    Jim
    last edited by 11 Jul 2011, 21:52

    @driven said:

    it splits out into layers, but doesn't group those items, I haven't read the script yet but is that addable? i.e. each layer's geometry is also a group so it doesn't stick on first opening with all layers on.

    Yes, I think it's addable. I was using SketchUp Pro's dxf importer as my example; which does not group geometry by layer. But it seems like a better way to import geometry seeing as cad layers are more like SketchUp Groups than SketchUp Layers. So would all entities in the group be on the cad layer, or just the group on the cad layer with the raw geom on Layer0?

    @driven said:

    also does it do faces?, I'm not sure if this test file has any... a lot of them don't.

    Not really yet. It does import 3DFACE entities, but I think they are not common in dxf's.

    I appreciate the feedback. (send test files.)

    Hi

    1 Reply Last reply Reply Quote 0
    • H Offline
      Humpmetwice
      last edited by 12 Jul 2011, 01:31

      By reading everything I'm not sure if I'm doing something wrong or its not able to import text yet? It would really be a helpful tool if it did!

      Thanks Kurt


      2011-07-11_201346.png


      2011-07-11_201529.png

      1 Reply Last reply Reply Quote 0
      • J Offline
        Jim
        last edited by 12 Jul 2011, 07:22

        Thanks Kurt. It should import text and mtext entities. I would be interested in testing your .dxf file, if possible.

        Hi

        1 Reply Last reply Reply Quote 0
        • H Offline
          Humpmetwice
          last edited by 12 Jul 2011, 17:31

          @jim said:

          Thanks Kurt. It should import text and mtext entities. I would be interested in testing your .dxf file, if possible.

          Hope this helps, I think its just the type of text we used but I'm not sure. I was thinking it was standard MTEXT but may have been wrong?


          B05-7947EP.dxf

          1 Reply Last reply Reply Quote 0
          • H Offline
            honoluludesktop
            last edited by 12 Jul 2011, 18:30

            I just accidentally discovered that you can drag and drop some dxf files into IE and it will open to view. Jim's reference file opens, but humpmetwice's doesn't. Is it a Acad created file?


            temp.png

            1 Reply Last reply Reply Quote 0
            • J Offline
              Jim
              last edited by 12 Jul 2011, 19:33

              @honoluludesktop said:

              I just accidentally discovered that you can drag and drop some dxf files into IE and it will open to view. Jim's reference file opens, but humpmetwice's doesn't. Is it a Acad created file?

              @HDT - Do you have AutoCAD installed, or a dxf/dwg viewer that enables the browser to display them using a add-on? (My guess.)

              @Kurt - Thanks. This is what I get when importing your .dxf. It looks mostly OK, except the texts are not rotated (which I am aware but haven't fixed that yet.)

              Untitled.png

              Hi

              1 Reply Last reply Reply Quote 0
              • H Offline
                honoluludesktop
                last edited by 12 Jul 2011, 19:40

                I have a old copy of volo, but it was a popup that prompted a activeX download to then open the dxf to view. Are they related?

                Btw, Jim, do you know if the majority of the non text/dimension entities in your reference file are polylines?

                1 Reply Last reply Reply Quote 0
                • H Offline
                  Humpmetwice
                  last edited by 12 Jul 2011, 20:27

                  @jim said:

                  @Kurt - Thanks. This is what I get when importing your .dxf. It looks mostly OK, except the texts are not rotated (which I am aware but haven't fixed that yet.)

                  Far more than what I get! I think I could work with that if you would tell me the secret to what I may be doing wrong. Is it the text we use?
                  Thanks Kurt

                  1 Reply Last reply Reply Quote 0
                  • D Offline
                    driven
                    last edited by 12 Jul 2011, 21:58

                    when I first import and use zoom extents I get this
                    initial import

                    then in SU, I deleted the \A1; text, I did 'select-all' to changed the font to momo 12pt, moved a couple of overlaps and in 'parallel projection' & 'top view'
                    I get this.
                    on the mac
                    the text is on Layer0
                    the model and dim lines are on the text layer,
                    and the dimensionline layer is empty

                    john
                    @Kurt hope you don't mind me testing your file, consistency helps debugging...

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

                    1 Reply Last reply Reply Quote 0
                    • J Offline
                      Jim
                      last edited by 12 Jul 2011, 22:21

                      @John - Select "No" for the Screen Text option to use 3D text (well, 3D in only 2D.)

                      Hi

                      1 Reply Last reply Reply Quote 0
                      • J Offline
                        Jim
                        last edited by 12 Jul 2011, 22:23

                        @unknownuser said:

                        @jim said:

                        @Kurt - Thanks. This is what I get when importing your .dxf. It looks mostly OK, except the texts are not rotated (which I am aware but haven't fixed that yet.)

                        Far more than what I get! I think I could work with that if you would tell me the secret to what I may be doing wrong. Is it the text we use?
                        Thanks Kurt

                        Just try the latest version. (This link is always the most recent.)

                        Hi

                        1 Reply Last reply Reply Quote 0
                        • J Offline
                          Jim
                          last edited by 12 Jul 2011, 23:02

                          @driven said:

                          the text is on Layer0
                          the model and dim lines are on the text layer,
                          and the dimensionline layer is empty

                          Yes, this is similar to what I get when using SketchUp's Pro dxf importer.

                          (added text rotation, btw in latest. v0.6.1)

                          Hi

                          1 Reply Last reply Reply Quote 0
                          • thomthomT Offline
                            thomthom
                            last edited by 22 Aug 2011, 09:19

                            I've been looking around at the various ruby based importers for SketchUp and I see that no one uses the Importer class. If this class is used the importer can be found in the native import list which would be very nice.
                            http://code.google.com/apis/sketchup/docs/ourdoc/importer.html

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

                            1 Reply Last reply Reply Quote 0
                            • D Offline
                              Dekker
                              last edited by 12 Nov 2011, 13:49

                              It looks like the "inputbox.rb" plugin is no longer found in bitbucket ๐Ÿ˜ž

                              Any alternates available?

                              EDIT: Never mind... Found it! For the reference of others, the source is located here: http://forums.sketchucation.com/viewtopic.php?f=323&t=19103&p=347871&hilit=+inputbox.rb+#p347871

                              1 Reply Last reply Reply Quote 0
                              • J Offline
                                Jim
                                last edited by 12 Nov 2011, 15:52

                                Sorry 'bout that, Dekker. I am haphazard with my plugins - but I'm glad you found inputbox.rb

                                Any thoughts on the importer?

                                Hi

                                1 Reply Last reply Reply Quote 0
                                • thomthomT Offline
                                  thomthom
                                  last edited by 20 Dec 2011, 14:04

                                  The link to inputbox.rb is dead.

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

                                  1 Reply Last reply Reply Quote 0
                                  • thomthomT Offline
                                    thomthom
                                    last edited by 20 Dec 2011, 14:17

                                    Does it handle materials in any way?

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

                                    1 Reply Last reply Reply Quote 0
                                    • J Offline
                                      Jim
                                      last edited by 21 Dec 2011, 21:46

                                      @thomthom said:

                                      Does it handle materials in any way?

                                      No. I don't remember seeing a "material" or "color" property for dxf entities. Isn't the color based on an entities' layer?

                                      Hi

                                      1 Reply Last reply Reply Quote 0
                                      • TIGT Online
                                        TIG Moderator
                                        last edited by 21 Dec 2011, 22:28

                                        You are right.
                                        A DXF file gives objects layers, and those layers have colors.
                                        If you take the SKP layers the colors export as random colors.
                                        Even with similar SKPs newly made layers get unconnected colors.
                                        It's possible to rationalize a DXF by post processing it's text - I have a commercial tool I've written which uses the native DXF exporter, but where the client wanted all DXF layers to be consistently colored; so it has a 'lookup table' and ensures consistency by 'stream-editing' the DXF's text after it's made.
                                        Another way to have materials==colors is to export a custom made DXF but ignore the SKP's layers and using each material as if it were a DXF-layer... that way objects in the DXF are then grouped by each DXF 'layer' which is really made from the SKP's material-color rather than the proper SKP-layer...

                                        TIG

                                        1 Reply Last reply Reply Quote 0
                                        • J Offline
                                          Jim
                                          last edited by 21 Dec 2011, 22:42

                                          Dec 2011 - I have removed the external dependency on my inputbox.rb - it is no longer required as a separate download. Also, I attached the download to the first post of this topic rather than linking to an external site. Hopefully, these changes will make it easier for folks to try.

                                          Hi

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

                                          Advertisement