Specifies whether the external reference or viewport has layer property overrides.
Supported platforms: Windows only
Signature
VBA:
object.LayerPropertyOverrides
- object
-
Type: ComparedReference, ExternalReference, PViewport
The object this property applies to.
Property Value
Read-only: Yes
Type: Boolean
- True: External reference or viewport has layer property overrides.
- False: External reference or viewport does not have layer property overrides.
Remarks
The ComparedReference object inherits this property from ExternalReference, but this property doesn't affect objects of the ComparedReference type when used.
Examples
VBA:
Sub Example_LayerPropertyOverrides() ' This example checks to see if the viewports in Paper Space ' have one or more layer property overrides applied. Dim acObj As AcadObject ' Step through the objects in Paper space For Each acObj In ThisDrawing.PaperSpace ' Check to see if the object is a Viewport If acObj.ObjectName = "AcDbViewport" Then ' Display the Layer Properties Override status for the viewport GoSub DISPLAYSTATUS End If Next acObj Exit Sub DISPLAYSTATUS: Dim vpObj As AcadPViewport Set vpObj = acObj ' Get the ObjectId for the viewport Dim strObjId as string strObjId = "ObjectId: " + CStr(vpObj.ObjectId) ' Display a message based on whether the viewport has layer overrides applied If vpObj.LayerPropertyOverrides Then MsgBox strObjId + vbLf + "Viewport does have layer property overrides applied.", , "LayerPropertyOverrides Example" Else MsgBox strObjId + vbLf + "Viewport doesn't have any layer property overrides applied.", , "LayerPropertyOverrides Example" End If Return End Sub
Visual LISP:
(vl-load-com) (defun c:Example_LayerPropertyOverrides() ;; This example checks to see if the viewports in Paper Space ;; have one or more layer property overrides applied. (setq acadObj (vlax-get-acad-object)) (setq doc (vla-get-ActiveDocument acadObj)) ;; Step through the objects in Paper space (vlax-for acObj (vla-get-PaperSpace doc) ;; Check to see if the object is a Viewport (if (= (vla-get-ObjectName acObj) "AcDbViewport") (progn ;; Get the ObjectId for the viewport (setq strObjId (strcat "ObjectID: " (itoa (vla-get-ObjectId acObj)))) ;; Display a message based on whether the viewport has layer overrides applied (if (= (vla-get-LayerPropertyOverrides acObj) :vlax-true) (alert (strcat strObjId "\nViewport does have layer property overrides applied.")) (alert (strcat strObjId "\nViewport doesn't have any layer property overrides applied.")) ) ) ) ) )