Author Topic: DXF Code - Layer Description  (Read 874 times)

0 Members and 1 Guest are viewing this topic.

Matthew H

  • Newt
  • Posts: 70
DXF Code - Layer Description
« on: July 27, 2022, 02:39:48 PM »
Does anyone know what the DXF code is for a Layer's Description?
I was using the following to view the properties of a specific layer.
I am viewing the layer through AutoCAD's Symbol Table.
"https://help.autodesk.com/view/ACD/2023/ENU/?guid=GUID-7B91F774-B0CD-4F5B-9FFA-1130443E659B"
Code - Auto/Visual Lisp: [Select]
  1. (entget (tblobjname "Layer" "LAYERNAME"))

Code - Auto/Visual Lisp: [Select]
  1. (
  2. ;APP: entity name.
  3. (-1 . <Entity name: 1b71cbbcea0>)
  4. ;Entity type (table name)
  5. (0 . "LAYER")
  6. ;Soft-pointer ID/handle to owner object
  7. (330 . <Entity name: 1b71cb6b020>)
  8. ;Handle (all except DIMSTYLE
  9. (5 . "D7A")
  10. ;Subclass marker (AcDbSymbolTable)
  11. (100 . "AcDbSymbolTableRecord")
  12. ;Subclass marker (AcDbSymbolTable)
  13. (100 . "AcDbLayerTableRecord")
  14. ;Name (attribute tag, block name, and so on)
  15. (2 . "Layeraaa")
  16. ;State Flag (1=Frozen, 2=Frozen in New Viewport, 4=Locked)
  17. (70 . 0)
  18. Color Number (If Negative, Layer is Off)
  19. (62 . 7)
  20. ;Linetype name (fixed)
  21. (6 . "Continuous")
  22. ;Plotting Flag (0=don't plot ,1=plot)
  23. (290 . 1)
  24. ;Lineweight enum value (AcDb::LineWeight).
  25. (370 . -3)
  26. ;Hard-pointer ID/handle of PlotStyleName object
  27. (390 . <Entity name: 1b71cb6b0f0>)
  28. ;Hard-pointer ID/handle to Material object
  29. (347 . <Entity name: 1b71cb6b600>)
  30. ;Hard-pointer ID/handle to visual style object (optional)
  31. (348 . <Entity name: 0>)
  32. )

I do not see any DXF codes regarding layer description.
https://help.autodesk.com/view/ACD/2022/ENU/?guid=GUID-3F0380A5-1C15-464D-BC66-2C5F094BCFB9#!
https://forums.autodesk.com/t5/net/finding-dxf-codes/td-p/2386631?attachment-id=491553
http://docs.autodesk.com/ACD/2011/ENU/filesDXF/WS1a9193826455f5ff18cb41610ec0a2e719-7a51.htm
Though, I do see DXF code "#1003 - Extended Layer Name". When is this code used?

If anyone knows where the layer description is stored, that would be much appreciated.

Thanks,
Matthew H.
« Last Edit: July 28, 2022, 07:58:27 AM by Matthew H »

JohnK

  • Administrator
  • Seagull
  • Posts: 10664
Re: DXF Code - Layer Description
« Reply #1 on: July 27, 2022, 02:58:14 PM »
This was in my notes. Sorry my notes on the layer topic is very short (this is it) and void of any links to further reading.

Code - Auto/Visual Lisp: [Select]
  1. ;; LAYER group codes
  2. ;;  
  3. ;; Group codes -   Description
  4. ;;  
  5. ;; 100 - Subclass marker (AcDbLayerTableRecord)
  6. ;;  
  7. ;; 2  -   Layer name
  8. ;;  
  9. ;; 70 - Standard flags (bit-coded values):
  10. ;; 1  = Layer is frozen; otherwise layer is thawed
  11. ;; 2  = Layer is frozen by default in new viewports
  12. ;; 4  = Layer is locked
  13. ;; 16 = If set, table entry is externally dependent on an xref
  14. ;; 32 = If both this bit and bit 16 are set, the externally
  15. ;;      dependent xref has been successfully resolved
  16. ;; 64 = If set, the table entry was referenced by at least
  17. ;;      one entity in the drawing the last time the drawing
  18. ;;      was edited. (This flag is for the benefit of AutoCAD
  19. ;;      commands. It can be ignored by most programs that
  20. ;;      read DXF files and need not be set by programs that
  21. ;;      write DXF files)
  22. ;;  
  23. ;; 62 - Color number (if negative, layer is off)
  24. ;;  
  25. ;; 6 - Linetype name
  26. ;;  
  27. ;; 290 - Plotting flag. If set to 0, do not plot this layer
  28. ;;  
  29. ;; 370 - Lineweight enum value
  30. ;;
  31. ;; 380 - Ploy Style Name
  32. ;;  
  33. ;; 390 - Hard-pointer ID/handle of PlotStyleName object
  34.  
  35.            '(0 . "LAYER")
  36.            '(100 . "AcDbSymbolTableRecord")
  37.            '(100 . "AcDbLayerTableRecord")
  38.            (cons 2 "G-Anno-Note") ; layername
  39.            (cons 70 0) ; stuff
  40.            (cons 62 141); color number
  41.            ;; (cons 290 ; plot
  42.            (cons 6 "Continuous") ;; linetype
  43.            (cons 370 050)
  44.            ;;  LAYER LINEWEIGHT
  45.            ;;  this should be an integer representing one of the standard lineweight
  46.            ;;  values multiplied by 100 (i.e. 2.11mm becomes 211). Use -3 to specify the
  47.            ;;  'Default' lineweight.
  48.  
  49.            ;; (cons 390 "Normal")
  50.  
  51.            (list -3 (list "AcAecLayerStandard" '(1000 . "") (cons 1000 "This is a description")))
  52.          )
  53. )
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

Matthew H

  • Newt
  • Posts: 70
Re: DXF Code - Layer Description
« Reply #2 on: July 27, 2022, 03:10:40 PM »
This was in my notes. Sorry my notes on the layer topic is very short (this is it) and void of any links to further reading.
John,

Thank you for posting your notes.
I was able to read the information with
Code - Auto/Visual Lisp: [Select]
  1. (entget(tblobjname "LAYER" "LAYERNAME")'("AcAecLayerStandard"))

Which add the following to the entgent.
Code - Auto/Visual Lisp: [Select]
  1. (-3 ("AcAecLayerStandard" (1000 . "") (1000 . "Sample Description Info"))

My Swamp searching skills need better work.
I have found this as a reference.
https://www.theswamp.org/index.php?topic=53135.0

Thanks,
Matthew H.
« Last Edit: July 27, 2022, 03:35:19 PM by Matthew H »

Lee Mac

  • Seagull
  • Posts: 12927
  • London, England
Re: DXF Code - Layer Description
« Reply #3 on: July 27, 2022, 06:17:57 PM »
In general, whenever attempting to ascertain where particular data is stored within the DXF data for an entity, I would always suggest creating an entity (be it graphical or non-graphical, such as a layer) with the target properties, and then inspect the DXF data using a utility such as my Entity List function (or a similar function of the same nature).

For your case, you might observe data such as the following:
Code - Auto/Visual Lisp: [Select]
  1. _$ (elist (tblobjname "layer" "0"))
  2.  
  3. (
  4.     (-1 . <Entity name: 7ff434803900>)
  5.     (0 . "LAYER")
  6.     (5 . "10")
  7.     (102 . "{ACAD_XDICTIONARY")
  8.     (360 . <Entity name: 7ff4348051e0>)
  9.     (102 . "}")
  10.     (330 . <Entity name: 7ff434803820>)
  11.     (100 . "AcDbSymbolTableRecord")
  12.     (100 . "AcDbLayerTableRecord")
  13.     (2 . "0")
  14.     (70 . 0)
  15.     (62 . 7)
  16.     (6 . "Continuous")
  17.     (290 . 1)
  18.     (370 . -3)
  19.     (390 . <Entity name: 7ff4348038f0>)
  20.     (347 . <Entity name: 7ff434803e00>)
  21.     (348 . <Entity name: 0>)
  22.     (-3
  23.         (
  24.             "AcAecLayerStandard"
  25.             (1000 . "")
  26.             (1000 . "Layer 0 Description")
  27.         )
  28.     )
  29. )

Note also that you may need to use regapp to register the AcAecLayerStandard xdata application ID if such ID is not already registered in the drawing.