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
note:list is a list of list example ((10 4 5)(5 6 7)(8 9 10)...)
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
Solved! Go to Solution.
Solved by EnM4st3r. Go to Solution.
Solved by EnM4st3r. Go to Solution.
do not use "list" as a variable as its a function.
Also how do you want to define the list? if its from outside the function its better to set it as an argument for your function like that:
(defun premier (lst /)...)
What exactly do you mean? Where should the loop be?
I want that loop to be inside the command or use some type of subroutine.
i dont know if thats the loop you want and i dont know if this'll work but heres a loop inside a command.
(defun premier (lst block acpv align / cnt)
(setq cnt 0)
(command "._SemiAutoGenerate" block "" "" aling "" "")
(while (< cnt (length lst))
(if (= 1 ACPV)
(command (nth cnt lst))
)
(setq cnt (1+ cnt))
);end while
(command "" "" "")
);end defun
thank you very much to all. Let me summarize a bit, the command is not a native AutoCAD command, it calls block which I give it to you before and aling which I give it to you before top and takes it to the nth part which is where there is a list with sublists and each cnt takes an element of They are the same. I want to integrate this into the vomsndo dedoues of block and aling. I'll try your solution and tell you. I thank you and your advice, I am new to mlisp.
Can't find what you're looking for? Ask the community or share your knowledge.