BlackBox Posted September 2, 2010 Share Posted September 2, 2010 Have you tried the copyhist command? COPYHIST Copies the text in the command line history to the Clipboard. Command entry: copyhist The text is copied to the Clipboard. Source: http://docs.autodesk.com/ACD/2010/ENU/AutoCAD%202010%20User%20Documentation/index.html?url=WS73099cc142f48755-1257e12111bf108800e-2b2.htm,topicNumber=d0e5422 I just came accross this, but do not have 2010 software. Quote Link to comment Share on other sites More sharing options...
ChristinaSeay Posted September 2, 2010 Author Share Posted September 2, 2010 Hmmm... that command works on 2002... definitely worth a shot... I just have to parse clipboard contents to get the info I need... but it is in there at least. Thanks for that!! I'll post back if I get working in case someone else needs it. Quote Link to comment Share on other sites More sharing options...
BlackBox Posted September 2, 2010 Share Posted September 2, 2010 Good luck! Quote Link to comment Share on other sites More sharing options...
ChristinaSeay Posted September 2, 2010 Author Share Posted September 2, 2010 I think the gist of this is going to be something like (code is approximate... typing off the top of my head, so not 100% accurate): 1. User types "B1" in command line in AutoCAD that uses LISP to kick off ProgramX 2. ProgramX will do the following on load: - SendCommand("COPYHIST") - V_CopyHistResult as string = Clipboard.GetText - If V_CopyHistResult.LastIndexOf("B1") > V_CopyHistResult.LastIndexOf("B2") Then Run form B1, else Run form B2 Since LastIndexOf will return a -1 if it's not found, I shouldn't have to worry about null string values and the > and There may be a more efficient way to test all the values since there are about 12 possible entries... not just B1 and B2... but I'll investigate that as I go. Maybe the Select-Case statement like what was mentioned earlier. Thank-You guys for all your help!!!! Quote Link to comment Share on other sites More sharing options...
stmoong Posted September 3, 2010 Share Posted September 3, 2010 The Last Command Toolbar seems to be written in VBA, and the AcadDocument_BeginCommand is an event handler that traps the command name. Well, just throwing out some more ideas. Would the Document.CommandInProgress works for you? If it doesn't work, how about implementing an event handler for the Document.LispEnded or Document.CommandEnded event. In the event handler, you can get the command that raised this event, via CommandEventArgs.GlobalCommandName property. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.