Message 1 of 3

Not applicable
05-19-2020
02:33 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hey everyone,
I added this part to my perfectly working code, and for some reason now it crashes every time I want to run it. Can someone help me?
public sub
'add new layer
On Error Resume Next
Dim Lay As AcadLayer
Dim Color As AcadAcCmColor
Set Color = AcadApplication.GetInterfaceObject("AutoCAD.AcCmColor.22")
Color.SetRGB 80, 100, 244
Set Lay = ThisDrawing.Layers.Add("AnkersControle")
With Lay
.TrueColor = Color
.Freeze = False
.Lineweight = acLnWt009
End With
On Error GoTo 0
'set new layer as current
ThisDrawing.SendCommand "_-layer _make PCLayer" & vbCr & vbCr
End Sub
Solved! Go to Solution.