Copy from Autocad to Sketchup
-
@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.
-
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 ? -
@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.
-
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()
-
-
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?
-
I dont know where my replays are going?
-
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..
-
@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.
-
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 -
@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?
-
See Jim's list here.
http://sketchucation.com/forums/viewtopic.php?t=34840#p374097There are a few more perhaps added since then.
Advertisement