Message 1 of 4
activelayer in NET
Not applicable
07-20-2005
11:01 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
im coding a dll in VB.NET, working as a COM dll (it must run on various versions of ACAD, so i cant use managed code)
there is code that runs in my VB6 dll, but not in this VB.NET COM dll
it fails on ThisDrawing.ActiveLayer = CapaActual
anybody knows why?
Imports Autodesk.AutoCAD.Interop
Imports Autodesk.AutoCAD.Interop.Common
.....
xAcad = GetObject(, "AutoCAD.Application.16")
ThisDrawing = xAcad.ActiveDocument
.....
Dim sLayer As String
Dim CapaActual As AcadLayer
Dim CapaUsuario As AcadLayer
CapaUsuario = ThisDrawing.ActiveLayer
sLayer = ThisDrawing.ActiveLayer.Name
MsgBox(sLayer)
CapaActual = ThisDrawing.Layers.Add("0-IS-Indice")
ThisDrawing.ActiveLayer = CapaActual '<<<<
...
it also happen with
ThisDrawing.ActiveTextStyle = ThisDrawing.TextStyles.Item(sEstiloLetra)
thanks in advance
there is code that runs in my VB6 dll, but not in this VB.NET COM dll
it fails on ThisDrawing.ActiveLayer = CapaActual
anybody knows why?
Imports Autodesk.AutoCAD.Interop
Imports Autodesk.AutoCAD.Interop.Common
.....
xAcad = GetObject(, "AutoCAD.Application.16")
ThisDrawing = xAcad.ActiveDocument
.....
Dim sLayer As String
Dim CapaActual As AcadLayer
Dim CapaUsuario As AcadLayer
CapaUsuario = ThisDrawing.ActiveLayer
sLayer = ThisDrawing.ActiveLayer.Name
MsgBox(sLayer)
CapaActual = ThisDrawing.Layers.Add("0-IS-Indice")
ThisDrawing.ActiveLayer = CapaActual '<<<<
...
it also happen with
ThisDrawing.ActiveTextStyle = ThisDrawing.TextStyles.Item(sEstiloLetra)
thanks in advance