Jump to content

Recommended Posts

Posted (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 by lozanoma
Posted

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" "" "" "" )

 

Posted

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

 

Posted

Could you provide me with an example with vl-sendcommand?

Posted

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

 

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...