ripuz Posted April 9, 2014 Share Posted April 9, 2014 Hi! I want to run some code when the dwg file is being saved. A command reactor make this happen but it doesn´t fire if the X (close) is pressed and the user chooses to save. Like this: (setq saveReactor (vlr-command-reactor nil '((:vlr-CommandWillStart . cbFunction)))) (defun cbFunction (reactor commandNameList) (if (wcmatch (car commandNameList) "SAVE,SAVEAS,QSAVE") (alert "SAVED!") ) ) Is it possible to do something when the user chooses to save? Autopublish manages to do this... Thanks in advance Quote Link to comment Share on other sites More sharing options...
BlackBox Posted April 9, 2014 Share Posted April 9, 2014 (defun cbFunction (reactor commandNameList / commandName) (cond ((wcmatch (setq commandName (car commandNameList)) "CLOSE") (alert (strcat "Closing \"" (getvar 'dwgname) "\"")) ) ((wcmatch commandName "*SAVE*") (alert (strcat "Saving \"" (getvar 'dwgname) "\"")) ) ) (princ) ) Quote Link to comment Share on other sites More sharing options...
BlackBox Posted April 9, 2014 Share Posted April 9, 2014 Autopublish manages to do this... Autopublish is coded in either .NET, or ObjectARX (C++ for AutoCAD) API... There's a lot more that can be done using those in lieu of LISP. 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.