Jump to content

DXF code for Locked Layer


Sweety

Recommended Posts

DXF code 70

4=Locked

 

From Help

LAYER group codes

Group code Description

100 Subclass marker (AcDbLayerTableRecord)

2 Layer name

70 Standard flags (bit-coded values):

1 = Layer is frozen; otherwise layer is thawed

2 = Layer is frozen by default in new viewports

4 = Layer is locked

16 = If set, table entry is externally dependent on an xref

32 = If both this bit and bit 16 are set, the externally dependent xref has been successfully resolved

64 = If set, the table entry was referenced by at least one entity in the drawing the last time the drawing was edited. (This flag is for the benefit of AutoCAD commands. It can be ignored by most programs that read DXF files and need not be set by programs that write DXF files)

62 Color number (if negative, layer is off)

6 Linetype name

290 Plotting flag. If set to 0, do not plot this layer

370 Lineweight enum value

390 Hard-pointer ID/handle of PlotStyleName object

347 Hard-pointer ID/handle to Material object

 

Xref-dependent layers are output during SAVEAS. For these layers, the associated linetype name in the DXF file is always CONTINUOUS

Link to comment
Share on other sites

Thanks a lot for all your helps ..

 

And here is a peice of code I got it from Alanjt codes but with some modification to meet my question .......

 

(logand 4 (cdr (assoc 70 (entget (tblobjname "LAYER" (cdr (assoc 8 (entget (car (entsel "\nSelect something:" ))))))))))

 

Is this the only way to get it work ?

 

Greatly appreciated.

Link to comment
Share on other sites

> Is this the only way to get it work ?

 

But that doesnt work? ...Im confused.

 

Thanks Se7en for your interests.

 

The above codes would return number 4 which means that according to lspeifert and Alanjt is Locked.

 

So if you would like to check it for True or False you could add the following.

 

(eq 4 (logand 4 (cdr (assoc 70 (entget (tblobjname "LAYER" (cdr (assoc 8 (entget (car (entsel "\nSelect something:" ))))))))))) 

 

But I am sure that you know all of this don't you?

 

Many thanks.

Link to comment
Share on other sites

Thanks Se7en for your interests.

 

The above codes would return number 4 which means that according to lspeifert and Alanjt is Locked.

 

So if you would like to check it for True or False you could add the following.

 

(eq 4 (logand 4 (cdr (assoc 70 (entget (tblobjname "LAYER" (cdr (assoc 8 (entget (car (entsel "\nSelect something:" ))))))))))) 

 

Oh, okay. Yes you are correct. That will work to see if the layer of something selected is locked.

Link to comment
Share on other sites

Oh, okay. Yes you are correct. That will work to see if the layer of something selected is locked.

 

I am really happy that you got it work ....

 

Also I have seen that with VBA once before , and I hope someone could bring or write these codes for me and all ?

Maybe the following would get someone started ....

 

(setq *activeDoc* (vla-get-activedocument (vlax-get-acad-object)))
(and (setq ent (entsel "\n Select something :"))
    (setq obj (vlax-ename->vla-object (car ent)))
     )
(if (eq .............................

 

Many thanks.

Link to comment
Share on other sites

a revision to Alan's code

(setq obj (vlax-ename->vla-object (tblobjname "LAYER" (cdr (assoc 8 (entget (car (entsel "\nSelect something:" ))))))))
(if
 (=  :vlax-true (vlax-get-property obj 'Lock))
 (princ "The layer is locked")
 (princ "The layer is not locked")
 )

Link to comment
Share on other sites

a revision to Alan's code

(setq obj (vlax-ename->vla-object (tblobjname "LAYER" (cdr (assoc 8 (entget (car (entsel "\nSelect something:" ))))))))
(if
 (=  :vlax-true (vlax-get-property obj 'Lock))
 (princ "The layer is locked")
 (princ "The layer is not locked")
 )

 

Very nice . :)

 

Thank you so much lspeifert.

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