Qonfire Posted May 20, 2012 Share Posted May 20, 2012 Hello I spent 5 hours looking at this,please stop my sufferings. (defun tempList (theObject / item dwgName) ;;;i[color="red"]tem here is nil,object acaddocuments[/color] (vl-load-com) (setq theList '()) (vlax-for item theObject [color="red"] (setq dwgName (vlax-get-property item 'Name)) ;;;main question is in this line. 1.how can i see this item in "(vlax-get-acad-object", everything is here right?),before calling its property.I'm using a watch to see whats happening. 2.can you please tell me what do you think i should know on this issue[/color] (setq theList (append (list dwgName) theList)) ) (setq theList (reverse theList)) (princ) );defun (setq acadObject (vlax-get-acad-object)) (setq acadDocuments (vla-get-documents acadObject)) (tempList acadDocuments) Quote Link to comment Share on other sites More sharing options...
Tharwat Posted May 20, 2012 Share Posted May 20, 2012 What is your goal of the routine ? Quote Link to comment Share on other sites More sharing options...
pBe Posted May 20, 2012 Share Posted May 20, 2012 where theObject is (vla-get-documents (vlax-get-acad-object)) (vlax-for item theObject (setq dwgName (vlax-get-property item 'Name)) (setq theList (append (list dwgName) theList))) With how the code is setup now, you are collecting 'Name (drawing names) and saving those on a variable theList . a list of names. Now if you want to "see" the properties and methods (vlax-for item (vla-get-documents (vlax-get-acad-object)) (setq theList (append (list item) theList))) wherein you can have a look-see of the properties and methods (names included) of each element by (vlax-dump-object (nth 0 theList) T) ;<--- index 0 where 0 is the first and 1 as 2nd and so on Quote Link to comment Share on other sites More sharing options...
Qonfire Posted May 20, 2012 Author Share Posted May 20, 2012 What is your goal of the routine ? to store open drawings name in a (?symbol? setq) Quote Link to comment Share on other sites More sharing options...
Tharwat Posted May 20, 2012 Share Posted May 20, 2012 to store open drawings name in a (?symbol? setq) Ok, you got it fixed by pBe gently . EDIT : Another way of applying the list . (vlax-for item (vla-get-documents (vlax-get-acad-object)) (setq dwgNames (cons (vlax-get-property item 'Name) dwgNames)) ) (princ (apply 'strcat dwgnames)) Quote Link to comment Share on other sites More sharing options...
pBe Posted May 20, 2012 Share Posted May 20, 2012 to store open drawings name in a (?symbol? setq) Qonfire The routine you have strores the names on a list theList, when you run the routine (tempList acadDocuments) you will get something like ("Drawing2.dwg" "Drawing3.dwg"); the way the code is written, theList variable is not localize. you can then use that for either foreach / repeat / mapcar / vl-some etc... with each element as the argument. Quote Link to comment Share on other sites More sharing options...
Qonfire Posted May 20, 2012 Author Share Posted May 20, 2012 (vlax-for item theObject (setq dwgName (vlax-get-property item 'Name)) (setq theList (append (list dwgName) theList))) my question is before we make a list of names. lets say we have 2 dwg.opened. One is actifdocument on is document. i know how to get counts of dwg files...i can get name of a an actif document, but in the "watch", i dont see a non actif document. ok let me put it this way, i see that when this line is running it takes a non-actif document (if not mistaken) and than itirates. how can i see the avaible item in "watch" before running this line. or note: maybe in "watch" i cant see these items or i cant get to them. appreciated Quote Link to comment Share on other sites More sharing options...
pBe Posted May 20, 2012 Share Posted May 20, 2012 note: maybe in "watch" i cant see these items or i cant get to them.appreciated You can get to them, but in the "Watch" window its so fast you can't "see" it. You can however use a breakpoint, the evaluation will pause when it hits the that point and you can continue by pressing CTRL+F8. I bet you'll see the value on watch window changing. (setq dwgName (vlax-get-property item 'Name<put breakpoint here>))) Quote Link to comment Share on other sites More sharing options...
Qonfire Posted May 20, 2012 Author Share Posted May 20, 2012 please look at my picasso pic attached. question is in 1 jpeg does this vlax get item ,changes active document as it iterates? picture with an equal sign is second time item changes its name please just a last push:) Quote Link to comment Share on other sites More sharing options...
pBe Posted May 20, 2012 Share Posted May 20, 2012 The value for that will always be the "CURRENT" unless you invoke a vla-Activate , that will make the specified drawing active. Quote Link to comment Share on other sites More sharing options...
Qonfire Posted May 21, 2012 Author Share Posted May 21, 2012 (vla-item acadDocuments 0) 1 2 .....this what i think I looking.Thanks for help boys Quote Link to comment Share on other sites More sharing options...
pBe Posted May 21, 2012 Share Posted May 21, 2012 (vla-item acadDocuments 0) 1 2 .....this what i think I looking.Thanks for help boys No big deal Qonfire, All i did was add more confusion Moving along.... Cheers 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.