amb2301 Posted June 26, 2018 Posted June 26, 2018 Hi Friends, i need a lisp to select the block name called "xxx_box" from the current drawing, i need in such a way to select block only by Qselect method, please help me friends. Quote
rkmcswain Posted June 26, 2018 Posted June 26, 2018 How about this? (sssetfirst nil (ssget "_x" '((0 . "Insert")(2 . "xxx_box")))) Quote
amb2301 Posted June 26, 2018 Author Posted June 26, 2018 Awesome, its working like a charm, thank you so much rkmcswain Quote
amb2301 Posted June 26, 2018 Author Posted June 26, 2018 i need one help rkmcswain, i am doing a manual work(annotating) in following way... 1. click on the macro button from the tool bar 2. need to press the right side arrow key 5 times & hit enter key 3. then go to current modelspace & click near that block. requesting to please help me on this task. please let me know your requirements, can i post it as a new thread? Quote
BIGAL Posted June 27, 2018 Posted June 27, 2018 Back to 1st task adding a bit more auto load this (defun pb ( bname / ) (sssetfirst nil (ssget "_x" (list (cons 0 "Insert")(cons 2 bname)))) ) To use just type on command line (pb "Blockname") Quote
BIGAL Posted June 27, 2018 Posted June 27, 2018 amb2301 please explain what it is you are doing arrow 5 times ? some screen grabs maybe. 1st suggestion do item 3 1st not last. Quote
amb2301 Posted June 27, 2018 Author Posted June 27, 2018 Hi Bigal, Thank you so much for your suggestions, as you said i just need to do screen grab(just need to select options by pressing arrow keys), i tried a similar lisp from cadtutor, but its not working, could you please help me on that (defun c:box () (sssetfirst nil (ssget "_x" '((0 . "Insert")(2 . "XXX_BOX")))) (command "Pdm") (command "execute_settings") (command "XXXXXX_ANNO_CNTRL") (command "annotate") (defun test ( ) (LM:sendkeys "{RIGHT}") (princ)) (defun test ( ) (LM:sendkeys "{RIGHT}") (princ)) (defun test ( ) (LM:sendkeys "{ENTER}") (princ)) ;; Send Keys - Lee Mac ;; A wrapper function for the SendKeys method of the WSH (defun LM:sendkeys ( keys / wsh ) (setq wsh (vlax-create-object "WScript.Shell")) (vl-catch-all-apply 'vlax-invoke (list wsh 'sendkeys keys)) (vlax-release-object wsh) (princ) ) (vl-load-com) (princ) ) Quote
BIGAL Posted June 28, 2018 Posted June 28, 2018 I think we all need to take a few steps back and for you to explain what is it your trying to do, you need to press arrows but to what ? Is it all inside some other program ? PDM PDMODE Enter new value for PDMODE : what happens now ? Quote
amb2301 Posted June 29, 2018 Author Posted June 29, 2018 Hi All, There is a third party application making AutoCAD work with a separate Spatial Database. But its API does not expose all the functions that I need which prevents me from working full blast without using interactive sendkeys. My task is this: users can work with it manually but it is taking to much time so I need to automate their repetitive task of interactively clicking on each of those dialog boxes that the 3rd party application uses. Third party application creates a drop down menu addition to the standard AutoCAD menu. And that drop down menu is where I am supposed to start the automation process. I am trying to trigger a series of about 10 sendkeys statements which I am trying to run from lisp / VBA. What I notice with said sendkeys series of statements is it seems to be able to execute the first sendkeys call as I intended it, i.e. pop out a dialog box but then the -- 2nd to the 10th sendkeys call all end up on the command line instead of going to the dialog box (popped out by my first sendkeys statement) of which I intended all the those sendkeys statements to go. The command buttons are not triggerable from the command line of AutoCAD -- so I really have no choice but to try to manipulate those command buttons using sendkeys. Please help me with any idea you have in mind. Quote
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.