Aftertouch Posted April 25, 2017 Author Share Posted April 25, 2017 Hey Omega, Your code works fine too. Tho for our company with many users we prefer to be able to use the regular AutoCAD commands. So thats why i want to use 'reactors' instead of the 'simple' use or a new command. Thanks for the suggestion tho! Quote Link to comment Share on other sites More sharing options...
Roy_043 Posted April 25, 2017 Share Posted April 25, 2017 @Roy, small suggestion to shorten a few lines: (setq layNew (cond ((= cmd "ATTACH") "XREF") ((vl-position cmd '("XATTACH" "DWFATTACH")) "XREF-DWG") ((= cmd "IMAGEATTACH") "XREF-IMAGE") ((= cmd "PDFATTACH") "XREF-PDF") ((= cmd "POINTCLOUDATTACH") "XREF-POINTCLOUD") ((= cmd "COORDINATIONMODELATTACH") "XREF-COORDINATIONMODEL") ) ) (setq layNew (cadr (assoc cmd '( ("ATTACH" "XREF") ("XATTACH" "XREF-DWG") ("DWFATTACH" "XREF-DWG") ("IMAGEATTACH" "XREF-IMAGE") ("PDFATTACH" "XREF-PDF") ("POINTCLOUDATTACH" "XREF-POINTCLOUD") ("COORDINATIONMODELATTACH" "XREF-COORDINATIONMODEL") )) ) ) Good idea: apart from shortening the code it is probably faster as well. 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.