Author Topic: Get_File_Properties  (Read 22183 times)

0 Members and 2 Guests are viewing this topic.

Lee Mac

  • Seagull
  • Posts: 12906
  • London, England
Re: Get_File_Properties
« Reply #15 on: April 27, 2011, 08:46:18 AM »
Turns out some experimentation reveals that list is incomplete. See revision to first post. :)

Even more so in Windows7...

Using:

Code: [Select]
(setq ...
                    i           0
                )
                (if item
                    (while
                        (not
                            (eq ""
                                (caar
                                    (setq result
                                        (cons
                                            (cons
                                                (vlax-invoke
                                                    folder
                                                   'GetDetailsOf
                                                    items
                                                    (setq i (1+ i))
                                                )
                                                (vlax-invoke
                                                    folder
                                                   'GetDetailsOf
                                                    item
                                                    i
                                                )
                                            )   
                                            result
                                        )
                                    )
                                )
                            )
                        )
                    )
                )
...

Gives me 292 properties..  !   :lol:

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: Get_File_Properties
« Reply #16 on: April 27, 2011, 08:50:08 AM »
holy sh*t

I should have tried that code at home (Win7 Pro), I'm running Windows XP here (insert laughter as appropriate).  :-D
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

alanjt

  • Needs a day job
  • Posts: 5352
  • Standby for witty remark...
Re: Get_File_Properties
« Reply #17 on: April 27, 2011, 08:50:43 AM »
Civil 3D 2019 ~ Windohz 7 64bit
Dropbox

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: Get_File_Properties
« Reply #18 on: April 27, 2011, 08:52:51 AM »
Changed original post to check items 0 ... 299. :)
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

Andrea

  • Water Moccasin
  • Posts: 2372
Re: Get_File_Properties
« Reply #19 on: April 27, 2011, 08:54:19 AM »
This is nice !

Question..
is there any way to check if a file have digital signature ?
Keep smile...

andrew_nao

  • Guest
Re: Get_File_Properties
« Reply #20 on: April 27, 2011, 09:43:33 AM »
thanks for the share MP ill add this nice little function to my library for future use

pBe

  • Bull Frog
  • Posts: 402
Re: Get_File_Properties
« Reply #21 on: April 30, 2011, 08:47:59 AM »
Very Nice MP

Would it be too much trouble if you write this code in Python?

Thanks


MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: Get_File_Properties
« Reply #22 on: May 02, 2011, 09:44:01 AM »
Very Nice MP

Would it be too much trouble if you write this code in Python?

Thanks

You're welcome pBe. No trouble other than time commitments, I'll try later this week. It's pretty trivial, all one has to do is import the Dispatch function from win32com (e.g. from win32com.client.dynamic import Dispatch) and use it to create the top level objects (e.g. shell_app=Dispatch("Shell.Application")). There after just using standard dot notation to access methods and properties as applicable (e.g. name_space = shell_app.NameSpace('c:\\tests')) in concert with Python's native iteration tools to replicate what has been done via LISP in post #1. :)

thanks for the share MP ill add this nice little function to my library for future use

you're most welcome :)

This is nice !

Question..
is there any way to check if a file have digital signature ?

yes :lol:
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

xiaxiang

  • Guest
Re: Get_File_Properties
« Reply #23 on: May 02, 2011, 08:57:31 PM »
That's cool,Michael!
Coulnd I show it to all my workmates?

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: Get_File_Properties
« Reply #24 on: May 02, 2011, 09:09:19 PM »
But of course. :)
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

pBe

  • Bull Frog
  • Posts: 402
Re: Get_File_Properties
« Reply #25 on: May 03, 2011, 07:41:16 AM »

You're welcome pBe. No trouble other than time commitments, I'll try later this week. It's pretty trivial, all one has to do is import the Dispatch function from win32com (e.g. from win32com.client.dynamic import Dispatch) and use it to create the top level objects (e.g. shell_app=Dispatch("Shell.Application")). There after just using standard dot notation to access methods and properties as applicable (e.g. name_space = shell_app.NameSpace('c:\\tests')) in concert with Python's native iteration tools to replicate what has been done via LISP in post #1. :)


Thank you for the direction MP
I'll give it a try  :-)

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: Get_File_Properties
« Reply #26 on: May 03, 2011, 08:32:04 AM »
Thank you for the direction MP
I'll give it a try  :-)

You're very welcome pBe. :)
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

Andrea

  • Water Moccasin
  • Posts: 2372
Re: Get_File_Properties
« Reply #27 on: July 28, 2011, 04:13:29 PM »
Hi all,

thank you MP providing this noviltie..
reading metadata is now resolved thanks to your ingenuity.

But what about change or add metadata?

 after some research, here is what I found
 tested and working.

but being not a pro in script language I'll trust you LISP guru for the translation of this script in LISP.


Code: [Select]
'To change the comments out of an entire folder's files
   Dim objFSO
   Dim Files
     
   strPath = InputBox("Enter the location of the folder on the network.","Folder Location",1)
   Set objFSO = CreateObject("Scripting.FileSystemObject")
     
   Set objFolder = objFSO.GetFolder(strPath)
   Set tempFiles = objFolder.Files
   For Each File In tempFiles
       ChangeCommentforAllFile(File)
   Next
     
 Function ChangeCommentforAllFile(objFile)
    Dim objDoc : Set objDoc = CreateObject("DSOFile.OleDocumentProperties")
    objDoc.Open(objFile.Path)
    objDoc.SummaryProperties.Comments = "This is a new comment"
    objDoc.Save
 End Function


reference
http://technet.microsoft.com/fr-ca/library/ee692828(en-us).aspx

after that,....maybe all dwgprops can be update directly allowing best search in windows ??? ??

Keep smile...

alanjt

  • Needs a day job
  • Posts: 5352
  • Standby for witty remark...
Re: Get_File_Properties
« Reply #28 on: March 03, 2014, 10:33:16 AM »
Sorry to bring up an old thread, but I'm wondering how to access a set of file properties if you know the property name? Even more interesting, why would it be that, even when having it run through 1000 iterations, it still doesn't return everything displayed if you view the file properties?

To be more specific, I'm trying to retrieve the latitude and longitude from a geotagged image.
« Last Edit: March 03, 2014, 10:36:37 AM by alanjt »
Civil 3D 2019 ~ Windohz 7 64bit
Dropbox

kirby

  • Newt
  • Posts: 127
Re: Get_File_Properties
« Reply #29 on: March 03, 2014, 11:22:33 AM »
MS has been changing the numbered extended file properties with each Windows version.

See VB code example and property name / number listed here:
http://www.kixtart.org/forums/ubbthreads.php?ubb=showflat&Number=160880&page=1