Making a file as read only.

Making a file as read only.

Muhammed.OPERA
Advisor Advisor
1,264 Views
3 Replies
Message 1 of 4

Making a file as read only.

Muhammed.OPERA
Advisor
Advisor

Hi everyone,

I'm trying to add some things to my lisp to make the drawing as read only but avoiding doslib arx. Smiley Sad

I have seen that code but i don't understand it and it's not working :

(DEFUN VXGETFILEINFOS (FIL / FILOBJ FILSYS RETVAL)
(SETQ FILSYS (VLAX-CREATE-OBJECT "SCRIPTING.FILESYSTEMOBJECT")
RETVAL (COND
((= (VLAX-INVOKE FILSYS "FILEEXISTS" FIL) 0) NIL)
((SETQ FILOBJ (VLAX-INVOKE FILSYS "GETFILE" FIL))
(LIST
(VLAX-GET FILOBJ "DATECREATED")
(VLAX-GET FILOBJ "DATELASTMODIFIED")
(VLAX-GET FILOBJ "DATELASTACCESSED")
(VLAX-GET FILOBJ "TYPE")
(/ (VLAX-GET FILOBJ "SIZE") 1000.0)
(VLAX-GET FILOBJ "ATTRIBUTES")
)
)
(T NIL)
)
)
(IF FILOBJ (VLAX-RELEASE-OBJECT FILOBJ))
(VLAX-RELEASE-OBJECT FILSYS)
RETVAL
)

Do anyone have any idea to achieve that?


Muhammed Mamdouh (OPERA)
Structural Engineer, Instructor
Facebook |LinkedIn

EESignature

0 Likes
Accepted solutions (1)
1,265 Views
3 Replies
Replies (3)
Message 2 of 4

Scottu2
Advocate
Advocate
Accepted solution

Hello Muhammad.Opera,

 

When the routine is called  (setq A (VXGETFILEINFOS "c:/myfile.dwg"))

The value of A should be a list of the file attributes, dates, type, size, and attribute value

The routine only displays the current file status

The attribute value? If its a number like the Osmode the single value may represent multiple conditions.

It may not be possible to change the attribute of a drawing that is currently open.

 

See also Changing-file-attributes-with-lisp

 

 

Message 3 of 4

Muhammed.OPERA
Advisor
Advisor

Hi @Scottu2

Thanks a lot for that link, there i find a code that worked successfully.

 


Muhammed Mamdouh (OPERA)
Structural Engineer, Instructor
Facebook |LinkedIn

EESignature

0 Likes
Message 4 of 4

Anonymous
Not applicable

Hi

I want this code which work Successfully

0 Likes