06-24-2019
03:15 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
06-24-2019
03:15 AM
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
