The properties that you access when using the COM helpers of LISP are based on the ActiveX API.

If you look for the Transparency property in the ActiveX API, then you’ll find that it is only available for AcadRasterImage and AcadWipeout entities.

The Transparency for entities (which is only available in AutoCAD 2011) is provided by new interfaces like IAcadEntity2 and they are called EntityTransparency.

In case of layers however, there is no property like that.

That transparency value can be calculated from the layer’s XData. If it’s not there, then it’s the default 0%

; gets transparency in percentage (defun getLayerTransparency (layerName / layer transparency)(setq layer (tblobjname"LAYER" layerName)); get the XData of AcCmTransparency (setq transparency (cdr(assoc1071(cdar(cdr(assoc -3 (entget layer '("AcCmTransparency"))))))))(if(= transparency nil); if we did not get a value it must be the default 0% (setq transparency 0); if we got a value then calculate from it (progn; get the lower byte of the value 0..255 ; (100%..0% in the AutoCAD user interface)(setq transparency (lsh(lsh transparency 24)-24)); convert the value to a percentage (setq transparency (fix(-100(/ transparency 2.55))))); (progn); (if)

The properties that you access when using the COM helpers of LISP are based on the ActiveX API.

If you look for the Transparency property in the ActiveX API, then you’ll find that it is only available for AcadRasterImage and AcadWipeout entities.

The Transparency for entities (which is only available in AutoCAD 2011) is provided by new interfaces like IAcadEntity2 and they are called EntityTransparency.

In case of layers however, there is no property like that.

That transparency value can be calculated from the layer’s XData. If it’s not there, then it’s the default 0%

; gets transparency in percentage (defun getLayerTransparency (layerName / layer transparency)(setq layer (tblobjname"LAYER" layerName)); get the XData of AcCmTransparency (setq transparency (cdr(assoc1071(cdar(cdr(assoc -3 (entget layer '("AcCmTransparency"))))))))(if(= transparency nil); if we did not get a value it must be the default 0% (setq transparency 0); if we got a value then calculate from it (progn; get the lower byte of the value 0..255 ; (100%..0% in the AutoCAD user interface)(setq transparency (lsh(lsh transparency 24)-24)); convert the value to a percentage (setq transparency (fix(-100(/ transparency 2.55))))); (progn); (if)