Jump to content

List of Windows


Olhado_

Recommended Posts

I am wondering if there is a way in VBA or LISP that you can display the Window's list, either as a List or array, found when you manually click the "Windows" menu at the top of the screen.

Thanks.

Link to comment
Share on other sites

Here is one way.

 

(setq mylist '())
(vlax-for x
  (vla-get-documents
    (vlax-get-acad-object))
 (setq mylist (cons (vla-get-name x) mylist))  
)
; print the list
(mapcar 'print mylist)

Link to comment
Share on other sites

McSwain,

 

After reading the ACAD LISP reference on "vlax-for", am I right in saying that it is the VL alternative to "foreach"?

 

If so, what is the difference between "vlax-for" and "foreach"?

 

 

Thanks as always

 

Lee

Link to comment
Share on other sites

 

After reading the ACAD LISP reference on "vlax-for", am I right in saying that it is the VL alternative to "foreach"?

Not really an alternative since they are not interchangeable, but they do the same thing to different data types.

 

If so, what is the difference between "vlax-for" and "foreach"?

 

(foreach) evaluates each member of a list

(vlax-for) evaluates each member of a collection

Link to comment
Share on other sites

Ahh, I see now - just been experimenting with the code below:

 

(defun c:dumpdoc (/ obj)
 (setq obj (vlax-get-acad-object))
 (vlax-dump-object obj t)
 (vlax-release-object obj)
 (princ)
)

 

I see that when you use "vla-get-documents" it returns a and so I suppose vlax-for works on this :)

 

Thanks for your help McSwain, appreciated as always,

 

Cheers

 

Lee

Link to comment
Share on other sites

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...