MarcoW Posted April 28, 2009 Share Posted April 28, 2009 Hello again, When having multiple dwg's with multiple layouts per dwg: how can I create a drawing list? Each layout has a stamp called "title" that has several attributes like date, name and so on. I wonder if it is possible since all layouts use the same block for stamp, so all the same attributes will be present several times. This must be around but the search engines don't show me .... Thanks for all the help. Quote Link to comment Share on other sites More sharing options...
Patrick_35 Posted April 28, 2009 Share Posted April 28, 2009 Hello A example (defun c:lstdwg(/ dirbox Ouvrir_dessin_dbx rep lst fic dbx lay) (defun dirbox(/ cdl rep) (if (setq cdl (vlax-create-object "Shell.Application")) (progn (and (setq rep (vlax-invoke cdl 'browseforfolder 0 "Choose a directory" 512 "")) (setq rep (vlax-get-property (vlax-get-property rep 'self) 'path)) ) (vlax-release-object cdl) ) ) rep ) (defun Ouvrir_dessin_dbx(dwg / dbx doc lan) (vl-load-com) (setq dwg (findfile dwg)) (vlax-for doc (vla-get-documents (vlax-get-acad-object)) (and (eq (strcase (vla-get-fullname doc)) (strcase dwg)) (setq dbx doc lan T) ) ) (or dbx (progn (if (< (atoi (substr (getvar "ACADVER") 1 2)) 16) (setq dbx (vlax-create-object "ObjectDBX.AxDbDocument")) (setq dbx (vlax-create-object (strcat "ObjectDBX.AxDbDocument." (substr (getvar "ACADVER") 1 2)))) ) (vla-open dbx dwg) ) ) (list dbx lan) ) (vl-load-com) (if (setq rep (dirbox)) (if (setq lst (vl-directory-files rep "*.dwg" 1)) (foreach fic lst (if (setq dbx (ouvrir_dessin_dbx (strcat rep "/" fic))) (progn (princ (strcat "\n Working in " fic))(princ) (vlax-for lay (vla-get-layouts (car dbx)) (princ (strcat "\n\t\tLayout : " (vla-get-name lay)))(princ) ) (or (cadr dbx)(vlax-release-object (car dbx))) ) (princ (strcat "\n Can't read file " fic)) ) ) (alert "No dwg's File") ) ) (princ) ) @+ Quote Link to comment Share on other sites More sharing options...
MarcoW Posted May 1, 2009 Author Share Posted May 1, 2009 Hi Patrick, Thank you for your reply. When executing the command it shows me the drawing names with its layoutnames. I wanted to go further, read out the stamps attributes. I might try it myself (to add some functions) but I'm not that brilliant in lisp as you guys. Gr., Marco. Quote Link to comment Share on other sites More sharing options...
Patrick_35 Posted May 4, 2009 Share Posted May 4, 2009 Hi It might be well to focus research one can search for all attributes in a drawing with the example given, but it risks taking some time and a massive amount of information to be processed. You have an example that looks for attributes of a drawing. @+ 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.