|
Welcome, Guest.
|
||||||
| AutoLISP AutoLISP or Visual LISP, learn both here! |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Member
Join Date: 2000-11
Posts: 21
![]() |
Is there a way I can change the attribute of a file to read-only with lisp?
|
|
|
|
|
|
#2 |
|
Administrator
Join Date: 2000-11
Location: Turlock, CA
Posts: 3,411
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Its built into vba, but with lisp, you can use DOSlib from www.mcneel.com. Use the dos_attrib command.
__________________
──□ Ed □── |
|
|
|
|
|
#3 |
|
100 Club
Join Date: 2000-12
Posts: 126
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
... 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)
)
|
|
|
|
|
|
#4 |
|
Member
Join Date: 2000-11
Posts: 21
![]() |
Thanks everyone, Stig had what I was looking for.
|
|
|
|
|
|
#5 |
|
100 Club
Join Date: 2000-12
Posts: 126
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Don't forget Robert McNeel has what you are looking for. I just thought it'd be more fun to write one.
|
|
|
|
![]() |
|
||||||
| Thread Tools | |
| Display Modes | |
|
|
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 |