Saturday, November 21, 2009
Home   |   Search   |   About AUGI   |   My AUGI   |   Join Now

Go Back   AUGI Forums > AUGI Technical (English) > Programming > AutoLISP
 Welcome, Guest. 

Login

Join Now FAQ Members List Calendar Search Today's Posts Mark Forums Read

AutoLISP AutoLISP or Visual LISP, learn both here!

Reply
 
Thread Tools Display Modes
Old 2004-06-10, 05:30 PM   #1
pcs
Member
 
Join Date: 2000-11
Posts: 21
pcs is starting their journey
Default Changing file attributes with lisp

Is there a way I can change the attribute of a file to read-only with lisp?
pcs is offline   Reply With Quote
Old 2004-06-10, 05:39 PM   #2
Ed Jobe
Administrator
 
Ed Jobe's Avatar
 
Join Date: 2000-11
Location: Turlock, CA
Posts: 3,411
Ed Jobe is a shining starEd Jobe is a shining starEd Jobe is a shining starEd Jobe is a shining starEd Jobe is a shining starEd Jobe is a shining starEd Jobe is a shining starEd Jobe is a shining starEd Jobe is a shining starEd Jobe is a shining starEd Jobe is a shining star
Default

Its built into vba, but with lisp, you can use DOSlib from www.mcneel.com. Use the dos_attrib command.
__________________
──Ed ──
Ed Jobe is offline   Reply With Quote
Old 2004-06-10, 06:08 PM   #3
stig.madsen
100 Club
 
Join Date: 2000-12
Posts: 126
stig.madsen is glowing brightlystig.madsen is glowing brightlystig.madsen is glowing brightlystig.madsen is glowing brightlystig.madsen is glowing brightlystig.madsen is glowing brightlystig.madsen is glowing brightlystig.madsen is glowing brightlystig.madsen is glowing brightlystig.madsen is glowing brightlystig.madsen is glowing brightly
Default

... or write your own,

Code:
(defun SetRO (/ afile fso ofile ro)
  (cond
    ((and (setq aFile (getfiled "" "" "" 4))
          (setq fso (vlax-create-object "Scripting.FilesystemObject"))
          (setq oFile (vlax-invoke fso 'GetFile aFile))
     )
     (vlax-put-property oFile 'Attributes (setq ro (- 1 (logand 1 (vlax-get-property oFile 'Attributes)))))
     (princ (strcat "File set to " (nth ro '("Read-write" "Read-only"))))
     (vlax-release-object oFile)
     (vlax-release-object fso)
    )
  )
  (princ)
)
stig.madsen is offline   Reply With Quote
Old 2004-06-10, 06:22 PM   #4
pcs
Member
 
Join Date: 2000-11
Posts: 21
pcs is starting their journey
Default RE: Changing file attributes with lisp

Thanks everyone, Stig had what I was looking for.
pcs is offline   Reply With Quote
Old 2004-06-11, 01:44 PM   #5
stig.madsen
100 Club
 
Join Date: 2000-12
Posts: 126
stig.madsen is glowing brightlystig.madsen is glowing brightlystig.madsen is glowing brightlystig.madsen is glowing brightlystig.madsen is glowing brightlystig.madsen is glowing brightlystig.madsen is glowing brightlystig.madsen is glowing brightlystig.madsen is glowing brightlystig.madsen is glowing brightlystig.madsen is glowing brightly
Default

Don't forget Robert McNeel has what you are looking for. I just thought it'd be more fun to write one.
stig.madsen is offline   Reply With Quote
Reply


Go Back   AUGI Forums > AUGI Technical (English) > Programming > AutoLISP

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Copy Central File B. Strube Revit - Worksharing/Worksets 5 2004-09-24 05:32 PM
Ploting and Publish DWL file trevorh AutoCAD Plotting 2 2004-06-30 10:29 AM
linking a central file to the site plan produces errors JGAbbott Revit - Worksharing/Worksets 2 2004-01-12 01:43 AM
Changing attributes within a family after the fact... John K. Revit Architecture - Families 0 2003-05-16 05:09 AM


All times are GMT +1. The time now is 02:15 PM.