Complete the code to create a new layer named 'Walls'.
layer = acad.ActiveDocument.Layers.Add('[1]')
The Add method creates a new layer with the specified name. Here, 'Walls' is the correct layer name to create.
Complete the code to set the color of the layer to red using the color index.
layer.Color = [1]In AutoCAD, color index 1 corresponds to red. Setting the layer's color to this index changes its color to red.
Fix the error in the code to make the layer visible.
layer.[1] = False
IsFrozen instead of IsOff.IsVisible.Setting IsOff to False turns the layer on, making it visible. Other properties control freezing, locking, or do not exist.
Fill both blanks to lock the layer and freeze it.
layer.[1] = True layer.[2] = True
IsOff with freezing.IsVisible which is not a valid property.Setting IsLocked to True locks the layer, preventing edits. Setting IsFrozen to True freezes the layer, hiding it from view and improving performance.
Fill all three blanks to rename the layer and set it as current.
layer.Name = '[1]' acad.ActiveDocument.Layers.[2](layer) acad.ActiveDocument.ActiveLayer = acad.ActiveDocument.Layers.Item("[3]")
CurrentLayer.First, the layer's name is changed to 'Ceiling'. Then, SetCurrent method sets this layer as the current active layer. The last line confirms the active layer is the renamed one.
