Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.

@RoyWickrama_RWEI,

 

Hoping that below iLogic code may be helpful.

 

Sub Main()
    Dim oDrawDoc As DrawingDocument
    oDrawDoc = ThisApplication.ActiveDocument
    Dim oLayer As Layer
    ' oLayer = oDrawDoc.StylesManager.Layers.Item(68)
    oLayer = oDrawDoc.StylesManager.Layers.Item("Title (ISO)")
    Dim oNewLayer As Layer
    oNewLayer_Name = "XYZ"
    Try
    	oNewLayer = oLayer.Copy(oNewLayer_Name)
    Catch
    	MessageBox.Show("New layer, " & oNewLayer_Name & ": Exists", "Title")
    End Try
	ThisDrawing.Document.StylesManager.Layers(oNewLayer_Name).Visible = False
	ThisDrawing.Document.StylesManager.Layers(oNewLayer_Name).Plot = False
	
	Dim brownColor As Color
	brownColor = ThisApplication.TransientObjects.CreateColor(165, 42, 42) 

	' the attributes of the layer to use the color,
	' have a solid line type, and a specific width.
	oNewLayer.Color = brownColor
	oNewLayer.LineType = kContinuousLineType
	oNewLayer.LineWeight = 0.02
End Sub

 

Thanks and regards,


CHANDRA SHEKAR G
Developer Advocate
Autodesk Developer Network