sketchucation logo sketchucation
    • Login
    ℹ️ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info

    Exporting DXF files

    Scheduled Pinned Locked Moved Newbie Forum
    sketchup
    10 Posts 2 Posters 1.5k 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.
    • M Offline
      mbpetri
      last edited by

      Hi Guys an Gals,

      I use Sketchup 8 and 2013 for RC Model airplane design. When the design is finished, all my parts are flat 2D on a common plane. Using 2013, I export as DXF. The problem is that when I send the files to the laser cutting shop, they complain about "faceted" arcs and circles. No problem I thought, I import to AutoCAD 2010 and change the line segmented arcs and cirles to true AutoCAD style. But they still complain........

      The issue is, they are reading the files into Illustrator, then export their G-Code from there. They claim that Illustrator sees many errors, even when reading the AutoCAD file.

      Possibly ......

        • They don't know what they are doing
        • They are just jacking the price
        • Maybe there really is a problem

      Please, anyone with experience on these issues, comment on what's really going on.

      Thanks and Happy Holidays,
      Marty Petri

      1 Reply Last reply Reply Quote 0
      • TIGT Offline
        TIG Moderator
        last edited by

        Remember that exported 2d DXFs are made of all lines, so there are no arcs - just facets [these are intended for illustration use, not full-blown CAD use - hence the '2d' epithet] - however, exported 3d DXFs are made of proper lines, arcs, circles etc.

        You can export a 3d DXF from a 'flat set'.
        It's as easy as making the 2d line-only version... πŸ˜•

        TIG

        1 Reply Last reply Reply Quote 0
        • M Offline
          mbpetri
          last edited by

          @tig said:

          You can export a 3d DXF from a 'flat set'.
          It's as easy as making the 2d line-only version... πŸ˜•

          Hi TIG,

          Easy? Yes and No. If I take a part that is 3D, parallel, top view, and export as DXF, I have double lines (line on top of line) which will cause the laser to cut each line twice. Also, when I try to edit the part in AutoCAD, it sees it as a block, not individual lines and circles. If I delete the Block, the underlying lines and circles are segmented. Not sure what a block would do to the G-Code. πŸ˜•

          The one BIG advantage, if I collapse to a 2D part and export as 3D, I can move the entire block in AutoCAD and see any orphan lines left behind.

          Thanks for the insights,
          Marty

          1 Reply Last reply Reply Quote 0
          • M Offline
            mbpetri
            last edited by

            I have attached one of my files, fairly simple one. It has been collapsed to a 2D plane.

            Marty


            This is the simplest of my Parts

            1 Reply Last reply Reply Quote 0
            • TIGT Offline
              TIG Moderator
              last edited by

              This is the 3d dxf I made from your skp [Pro dxf-exporter].
              I exploded the containers back to geoemetry
              It's just edges and R12 [as set in dxf-export options].
              The arcs/curves/circles all retained their settings.
              In CAD, any 'segmentation' you see in an arc is the way the arc is represented to speed, it is a true arc...

              I can see that manually reducing all geometry to a flat 2d form before exporting it as a dxf is a pain.
              My Slicer5 exporter does that automatically by deleting unwanted geometry etc.
              This one-liner works on a selection, it will remove all faces and any edges that are not flat at z=0...

              m=Sketchup.active_model;s=m.selection;a=m.active_entities;m.start_operation('x');t=s.grep(Sketchup;;Face);a.erase_entities(t)if t[0];t=[];s.grep(Sketchup;;Edge).each{|e|t<<e unless e.start.position.z==0 && e.end.position.z==0};a.erase_entities(t)if t[0];m.commit_operation;
              

              This version retains the selected flat faces and orients them 'up' if needed

              m=Sketchup.active_model;s=m.selection;a=m.active_entities;m.start_operation('x');t=[];s.grep(Sketchup;;Edge).each{|e|t<<e unless e.start.position.z==0 && e.end.position.z==0};a.erase_entities(t)if t[0];s.grep(Sketchup;;Face).each{|e|e.reverse! if e.normal.z==-1};m.commit_operation;
              

              Panel F.dxf

              TIG

              1 Reply Last reply Reply Quote 0
              • M Offline
                mbpetri
                last edited by

                @tig said:

                This is the 3d dxf I made from your skp [Pro dxf-exporter].

                My Slicer5 exporter does that automatically by deleting unwanted geometry etc.

                This one-liner works on a selection, it will remove all faces and any edges that are not flat at z=0...

                m=Sketchup.active_model;s=m.selection;a=m.active_entities;m.start_operation('x');t=s.grep(Sketchup;;Face);a.erase_entities(t)if t[0];t=[];s.grep(Sketchup;;Edge).each{|e|t<<e unless e.start.position.z==0 && e.end.position.z==0};a.erase_entities(t)if t[0];m.commit_operation;
                

                This version retains the selected flat faces and orients them 'up' if needed

                m=Sketchup.active_model;s=m.selection;a=m.active_entities;m.start_operation('x');t=[];s.grep(Sketchup;;Edge).each{|e|t<<e unless e.start.position.z==0 && e.end.position.z==0};a.erase_entities(t)if t[0];s.grep(Sketchup;;Face).each{|e|e.reverse! if e.normal.z==-1};m.commit_operation;
                

                The file s exactly what I am looking for. I was with you right up to the point of the 1 liners.

                Where is this code entered?

                Marty

                1 Reply Last reply Reply Quote 0
                • TIGT Offline
                  TIG Moderator
                  last edited by

                  Work on a copy...
                  Explode the parts to be DXF exported.
                  'Select all' geometry to be 'flattened' and copy+paste the one-liner code into the Ruby Console +<enter>
                  Then export the DXF...
                  The DXF will consist of flat edges at z=0 - with faces if you use the second version...

                  TIG

                  1 Reply Last reply Reply Quote 0
                  • M Offline
                    mbpetri
                    last edited by

                    Thanks Tig, You have been a big help! The 1st script gives me better results. Is there a way to save the Ruby Script so I don't have to cut and paste every time I want to use it?
                    Marty

                    1 Reply Last reply Reply Quote 0
                    • TIGT Offline
                      TIG Moderator
                      last edited by

                      Try this...

                      (c) TIG 2013-2014
                      TIG-flatten.rb
                      Usage: Plugins > 'TIG.flatten'
                      Selected geometry is deleted unless it's an edge and its start/end z==0;
                      all faces are removed.
                      The result is a 'flat' 2d outline useful for 3d DXF export retaining arcs etc.

                      AutoInstall it from the RBZ... Preferences > Extension > Install... button [needs v8 latest or newer version]
                      For users with <v8M2 [update!!] - change the RBZ's suffix to .zip and extract it, and put the .rb file into the Plugins folder.

                      You will also need FULL read/write access to your Plugins folder.
                      As an Admin [if you aren't an Admin give yourself that power in the Users Control-Panel]
                      Select the Plugins folder's icon, right-click > context-menu > Properties > Security > Edit...
                      Give every user/group in the list FULL rights.
                      Apply/OK.

                      Also set SketchUp to 'run as admin'...
                      Select the SketchUp.exe icon, right-click > context-menu > Properties > Compatibility
                      Tick the bottom check box 'Always Run This Programs as an Administrator'.
                      Apply/OK.


                      TIG-flatten.rbz

                      TIG

                      1 Reply Last reply Reply Quote 0
                      • M Offline
                        mbpetri
                        last edited by

                        Thanks so much Tig

                        Marty

                        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