Jump to content

How to create a drawing list


MarcoW

Recommended Posts

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.

Link to comment
Share on other sites

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

@+

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

 

@+

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