Sweety Posted October 15, 2010 Share Posted October 15, 2010 Hello, What's the DXF code that indicates to the Locked Layer ? Thanks, Quote Link to comment Share on other sites More sharing options...
lpseifert Posted October 15, 2010 Share Posted October 15, 2010 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 Quote Link to comment Share on other sites More sharing options...
alanjt Posted October 15, 2010 Share Posted October 15, 2010 Use logand 4 Quote Link to comment Share on other sites More sharing options...
Sweety Posted October 15, 2010 Author Share Posted October 15, 2010 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. Quote Link to comment Share on other sites More sharing options...
Se7en Posted October 15, 2010 Share Posted October 15, 2010 > Is this the only way to get it work ? But that doesnt work? ...Im confused. Quote Link to comment Share on other sites More sharing options...
Sweety Posted October 15, 2010 Author Share Posted October 15, 2010 > 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. Quote Link to comment Share on other sites More sharing options...
Se7en Posted October 15, 2010 Share Posted October 15, 2010 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. Quote Link to comment Share on other sites More sharing options...
Sweety Posted October 15, 2010 Author Share Posted October 15, 2010 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. Quote Link to comment Share on other sites More sharing options...
lpseifert Posted October 15, 2010 Share Posted October 15, 2010 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") ) Quote Link to comment Share on other sites More sharing options...
Sweety Posted October 15, 2010 Author Share Posted October 15, 2010 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. Quote Link to comment Share on other sites More sharing options...
BIGAL Posted October 17, 2010 Share Posted October 17, 2010 I seem to remember a problem once a quirk layer off and frozen is -ve value ? not documented! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.