![]() Start by getting the pickfirst set or object selection a transparent command, but one with pickfirst support For the command that intercepts COPYCLIP, we need not only If there is some, send it to the command-lineĭoc.SendStringToExecute(text, true, false, true ) Var text = ( string )obj.GetData( "Text" ) If not, try to get text data from the clipboard "\x1B\x1B_.PASTECLIP ", true, false, true active commands (we may have been called transparently) If so, start the PASTECIP command, cancelling any ![]() Find out whether the clipboard contains AutoCAD data about the pickfirst set: it just needs to be transparentĪpplication. For our command to intercept PASTECLIP, we don't care We might also use this opportunity to add certain objects into the operation (although there are other ways this might be achieved inside AutoCAD). At a basic level, we can just hook into Ctrl-C and then look at the selection set chosen by the user: in our case we’re just going to write a message to the command-line mentioning the number of objects selected, but we might choose only to call COPYCLIP under certain circumstances. I decided to generalise the request (and ultimately the solution) to encompass copy operations, too. If it contains text, send it to the command-line. For instance, if the clipboard contains drawing data, let the PASTECLIP command have at it. This really sounded like an interesting little problem but also a very useful bit of functionality: basically you could have AutoCAD change its “paste” behaviour based on the type of data in the clipboard. Maybe this is just running a little function that runs before paste. I would want the “enhanced paste” routine to be able to run inside any other command gracefully. Its the transparent part I have never done. So I think I need to write a transparent function, make a command in the CUI that runs the function, and assign ctrl-v to it. I already tried removing the keyboard shortcuts to ctrl-v via the cui, and that just makes ctrl-v not do anything when command line does not have focus. I do not use ctrl-v for pasting entities, only text to command line. I thought this might be a topic you would be interested in. I genuinely didn’t think I’d manage to look into it before the break, but it tweaked my interest during my trip back from the UK: This was a fun question that came in from James Meading.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |