Olhado_ Posted January 29, 2009 Share Posted January 29, 2009 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. Quote Link to comment Share on other sites More sharing options...
rkmcswain Posted January 29, 2009 Share Posted January 29, 2009 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) Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted January 29, 2009 Share Posted January 29, 2009 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 Quote Link to comment Share on other sites More sharing options...
rkmcswain Posted January 29, 2009 Share Posted January 29, 2009 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 Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted January 29, 2009 Share Posted January 29, 2009 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 Quote Link to comment Share on other sites More sharing options...
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.