View Full Version : Having trouble Pasting Special: %PRODUCT Entities

2004-09-28, 02:18 PM
Hello friends,

I would like to know if anyone has info on how to Paste Special as a % PRODUCT Entity into ACAD from Excel. In order to do this I have to go to edit, then paste special, next choose % PRODUCT Entity, hit OK then pick my insertion point for the text. I know it's not to complicated but it is giving me alot of trouble. I can only find info on paste on OLE objects and I don't think that those will help (unless someone can explain how)! any information will help tremendously.


Ed Jobe
2004-09-28, 07:28 PM
The new is not good. Acad provides very little additional support for ole. The paste special command is typical of pasting in any app. The command is also dialog only. Since there is no command line version, you can't script it. I havn't looked into it, but if its possible, the windows api is probably your only option.

2004-09-28, 09:09 PM

Check out the following Technical Document on the Autodesk web site under the Knowledge Base section -

ID: TS76460 - Requirements to copy or paste Microsoft Excel OLE objects (http://usa.autodesk.com/adsk/servlet/ps/item?siteID=123112&id=3202810&linkID=2475323)

Have a good one, Mike

Ed Jobe
2004-09-28, 09:35 PM
That's not what he was looking for Mike. He wanted to do it programatically. I had a little more info to go on since he pm'd me. Thanks for trying. :-)

2004-09-28, 09:42 PM
Hi Ed

Doh! didn't realise Clint wanted to do it programmatically; he also PM'd me asking to offer a little feedback (I probably read his request wrong).

:beer: Mike

2004-09-28, 11:43 PM
I had the same problem linking RTF files. I used sendcommand to throw the dialog then the FindWindow API to get the dialog and the SetFocus API to obviously set focus to it before using SendKeys to process the dialog.
Regards - Nathan

2004-09-29, 12:47 PM
Let me do some research and get back to you guys, thanks for the feedback. I must research the windows API, am not sure what that actually means! I know you can type pastespec in the ACAD command line to activate the paste special command, isn't that what you mean by "command line version" eljobe?

Ed Jobe
2004-09-29, 02:09 PM
No, any command can be typed in the command line. A command that has a command line version, is one that has all of its options prompted to the command line and doesn't use any dialogs. That way you can enter the prompt info into a script. To call a command's command line version, you precede it with a hyphen. Try "layer" and "-layer". Now try "pastespec" and "-pastespec".

The trouble with pastespec is that acad is simply calling a standard windows dialog. The OS doesn't have any other version and adesk didn't write one. The windows os is written in C++ and the api is an application programming interface, a set of functions that wrap the C++ functions into ones that other higher level languages can use. A quick look didn't reveal anything you might be able to use.

2004-09-29, 05:12 PM
Your not suggesting all hope is lost are you? Should take a different route in order to have the text pasted into ACAD? The reason I would like to use the paste special %product entity, is it drops the spreadsheet in at the correct scale, and it is single line text that can be edited easily if need be. Currently we are just pasting it in but that has 3 major issues: 1. The text can not be edited as easily ( it must be done in a specific order).
2. The background of the spreadsheet stays white.
3. The image must be scaled to fit properly.

So you can see my problem, I can't figure out how to paste special (best way), and I don't want to just use the paste command (inserts poorly). What should I do?

Ed Jobe
2004-09-29, 06:17 PM
No, I wasn't suggesting that. Only that you need to look for other options. I try my best to stay away from OLE altogether since its not very workable. Its designed to just give you a snapshot. But cad operators have always wanted more out of it than it was designed for. Some have taken the approch to "link" Excel by programming a way of interpreting xl objects into acad objects. There is one source code project at cadvault.com and some commercial apps available.

2004-09-29, 09:03 PM
I am thinking on starting a new thread that will ask for more information dealing with windows API (since I have no prior experience as how set up the procedures). Although, it seem that you guys have a pretty good idea on the subject, so maybe I should just let this topic grow a little more. Any suggestions? Oh by the way, I would assume that the savimg command is the same (dialog only) as the 'pastspec, is that so? (I just happen to need that one next)