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

    Copy from Autocad to Sketchup

    Scheduled Pinned Locked Moved Developers' Forum
    14 Posts 6 Posters 3.6k Views 6 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.
    • T Offline
      trxsi
      last edited by

      Hi,

      Im new to both Autocad and Sketchup SDK. I have been searching on web for a way to copy 2d drawings from Autocad to Sketchup.

      I have already found https://github.com/janlelis/clipboard for clipboard handling in Ruby and https://bitbucket.org/jimfoltz/ruby-dxf-reader for reading DXF files but i don't know im on a right track or not? I found that Autocad creates temporary files for copied contents and i don't know where i can find them and how to read them back in Sketchup. My idea is to add an event handler to monitor ctrl-v events in sketchup (no necessary can be a custom command ) and check a folder for Autocad's temporary clipboard files then parse them. But i dont know how can i start.

      Can you help me on this please?

      Trxsi.

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

        Have you found out what data AutoCAD places on the clipboard? Does it perhaps include the path to the temp file there?

        Very interesting plugin idea you got there btw. πŸ‘ πŸ‘

        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

          @trxsi said:

          I have already found https://github.com/janlelis/clipboard for clipboard handling in Ruby

          That specific project seem to copy just text - but perhaps it can be used as a base.

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

          1 Reply Last reply Reply Quote 0
          • Dan RathbunD Offline
            Dan Rathbun
            last edited by

            Pasting can done cross-platform with:

            Sketchup.send_action("paste:")
            Try and see if you can copy 2D to clipboard in AutoCAD, then switch to SketchUp, and try a paste from the menu, or type the expression I gave in the Ruby Console.

            I see your on Mac ??

            I may have an idea to access Clipboard data, but only on PC Windows.
            Is that github project Mac or Windows ?

            I'm not here much anymore.

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

              @dan rathbun said:

              Is that github project Mac or Windows ?

              Cross platform - even Linux.

              I'm thinking it might be easier with a C Extension - avoiding all the dependencies that project has which is troublesome within SketchUp's shared environment.

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

              1 Reply Last reply Reply Quote 0
              • Dan RathbunD Offline
                Dan Rathbun
                last edited by

                I just tried drag and drop for both DWG and DXF, but the cursor changes to a "No Drop Here" cursor.

                The Pro version of SketchUp can import files via the UI manually, or via Ruby with Model.import()

                I'm not here much anymore.

                1 Reply Last reply Reply Quote 0
                • Dan RathbunD Offline
                  Dan Rathbun
                  last edited by

                  @thomthom said:

                  @dan rathbun said:

                  Is that github project Mac or Windows ?

                  Cross platform - even Linux.

                  I'm thinking it might be easier with a C Extension - ...

                  Hmmm.. a good candidate for addition to the API's UI module ??

                  I'm not here much anymore.

                  1 Reply Last reply Reply Quote 0
                  • T Offline
                    trxsi
                    last edited by

                    Wooow what a cool forum to ask question. Thank you so much!

                    Yes im using mac. Im confortable with C++, Obj-C, C, but not ruby at the moment. It would be nice if i have a chance to use something alternative to ruby.

                    As far as i understand Autocad stores file location and some meta data related to temporary file at memory for clipboard copy op. Currently i don't have Autocad installed on my machine and i could not tested or conformed this info.

                    Thank you!

                    What's next?

                    1 Reply Last reply Reply Quote 0
                    • T Offline
                      trxsi
                      last edited by

                      I dont know where my replays are going?

                      1 Reply Last reply Reply Quote 0
                      • Dan RathbunD Offline
                        Dan Rathbun
                        last edited by

                        What's next ??

                        Well, guess what? Ruby is itself written in C. So you can write extensions to Ruby in C. And plugins in Ruby are really also Ruby extensions.

                        See the last post in the [ Code Snippets ] sticky topic, for an index to C/C++ Ruby extensions topics, examples etc..

                        I'm not here much anymore.

                        1 Reply Last reply Reply Quote 0
                        • J Offline
                          Jim
                          last edited by

                          @trxsi said:

                          I dont know where my replays are going?

                          New users need to have replies approved to limit spam posts. You should be all set to post now.

                          Also, the dxf -> ruby lib on bitbucket is by me, so let me know if you have any questions.

                          Hi

                          1 Reply Last reply Reply Quote 0
                          • maxhouserocksM Offline
                            maxhouserocks
                            last edited by

                            Been wondering if anything ever happened with this or if there is something out there now that can do this. would love to just copy/past from autocad to sketchup.

                            thanks,
                            bob

                            Robert A. Christman
                            http://rachristman.blogspot.com/

                            1 Reply Last reply Reply Quote 0
                            • sdmitchS Offline
                              sdmitch
                              last edited by

                              @dan rathbun said:

                              Pasting can done cross-platform with:

                              Sketchup.send_action("paste:")

                              Hmmmm, makes one wonder how many other send_action commands there are that are not in the API?

                              Nothing is worthless, it can always be used as a bad example.

                              http://sdmitch.blogspot.com/

                              1 Reply Last reply Reply Quote 0
                              • Dan RathbunD Offline
                                Dan Rathbun
                                last edited by

                                See Jim's list here.
                                http://sketchucation.com/forums/viewtopic.php?t=34840#p374097

                                There are a few more perhaps added since then.

                                I'm not here much anymore.

                                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