lozanoma Posted November 23, 2023 Posted November 23, 2023 (edited) Thank you very much in advance. I have the following code (defun premier ( /) (setq cnt 0) (while (< cnt (length list)) (if (= 1 ACPV) (command "._SemiAutoGenerate" block "" "" aling "" "" (nth cnt list) "" "" "" ) ) (setq cnt (+ cnt 1)) );end while );end defun that calls a command that does not belong to autocad, but to an external application. My problem is that I have created a loop with while that repeats the command n times, I want that loop to be inside the command or use some type of subroutine. I think it's impossible. thank you so much Edited November 23, 2023 by lozanoma Quote
BIGAL Posted November 23, 2023 Posted November 23, 2023 You may want Vl-cmf or vl-sendcommand method rather than using Command. Does it work if you say supply all values block, aling & item in list. Make the 1 line and copy to command line. (command "._SemiAutoGenerate" "MYBLOCK" "" "" 20 "" "" "LISTitem" "" "" "" ) Quote
lozanoma Posted November 24, 2023 Author Posted November 24, 2023 First thank you for your response. The problem is that the list that is saved in "list" is a list of lists, it is not a single list, the problem is that I want to execute the list of list without the command being activated n times Quote
lozanoma Posted November 24, 2023 Author Posted November 24, 2023 Could you provide me with an example with vl-sendcommand? Quote
BIGAL Posted November 26, 2023 Posted November 26, 2023 Like this (vla-sendcommand (vla-get-activedocument (vlax-get-acad-object)) "Vlide ") (vla-sendcommand acdoc "_.script C:\\Alan\\blkins.scr") ; run script file as insert will read entire line 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.