Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

load and execute a vlx with a single command

6 REPLIES 6
SOLVED
Reply
Message 1 of 7
robert06
736 Views, 6 Replies

load and execute a vlx with a single command

Can a VLX be loaded and run with a single command? Command "dxedel" here is defined in DXEdel.vlx, but it won't run just like that.. The VLX loads fine when "dxd" is run, but i get 'unknown command' when "dxedel" should be executed. Thank you!

 

(defun c:dxd ()
(vl-load-com)
(load "DXEdel")

(command "dxedel")
(princ)
)

6 REPLIES 6
Message 2 of 7
hmsilva
in reply to: robert06

Try changing
(command "dxedel")
to
(c:dxedel)
or
(dxedel)

HTH
Henrique

EESignature

Message 3 of 7
robert06
in reply to: hmsilva

works with  (c:dxedel)

 

thank you!

Message 4 of 7
hmsilva
in reply to: robert06

You're welcome, robert06
Glad I could help

Henrique

EESignature

Message 5 of 7
robert06
in reply to: hmsilva

Hi,

 

how to apply selection set for a loaded lisp command "Iburst"? (c:iburst xxblks) is incorrect:

 

(defun c:bss1 () ;; iburst blocks "l1" and "z"
(load "BurstUpgradedV1-2_IBURST.lsp")
(if (setq blks (ssget "_x" (list '(0 . "insert") (cons 2 "l1,z,`*U*"))))
    (progn
      (setq i   0
    xxblks (ssadd)
      );; setq
      (while (setq hnd (ssname blks i))
(setq blkn (vla-get-effectivename (vlax-ename->vla-object hnd)))
(if (wcmatch blkn "l1,z")
  (ssadd hnd xxblks)
);; if
(setq i (1+ i))
      );; while
      (if xxblks
(c:iburst xxblks)
      );; if
    );; progn
  );; if
(princ)
)

 

Message 6 of 7
Kent1Cooper
in reply to: robert06

I don't have that function to try it, but one way that kind of thing is sometimes done is to have the selection set selected/gripped/highlighted as a pre-selection, and then apply the command:

 

      (if xxblks

        (progn

          (sssetfirst nil xxblks)
          (c:iburst)
        ); progn

      );; if

Kent Cooper, AIA
Message 7 of 7
robert06
in reply to: Kent1Cooper

Got it, thanks.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost