.NET

Reply
Member
Posts: 3
Registered: ‎07-20-2005
Message 1 of 4 (341 Views)

activelayer in NET

341 Views, 3 Replies
07-20-2005 11:01 AM
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
Member
Posts: 3
Registered: ‎07-20-2005
Message 2 of 4 (341 Views)

Re: activelayer in NET

07-20-2005 11:03 AM in reply to: Inner
it also happen with

ThisDrawing.ActiveTextStyle = ThisDrawing.TextStyles.Item(sEstiloLetra)

thanks in advance
Distinguished Contributor
Posts: 210
Registered: ‎10-03-2003
Message 3 of 4 (341 Views)

Re: activelayer in NET

07-20-2005 11:37 AM in reply to: Inner
I think its formatted something like

ThisDrawing.SetVariable("CLAYER", 0-IS-Indice)
Member
Posts: 3
Registered: ‎07-20-2005
Message 4 of 4 (341 Views)

Re: activelayer in NET

07-20-2005 11:51 AM in reply to: Inner
wow, it works
thanks a lot

there is a lot of stuff running about managed code in NET, but not about the new syntax for usual COM projects in NET

im really lost with this situation

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Are you interested in helping shape the Autodesk Community?
We’re looking at a few different ways to improve the “All Forums” landing page and need your feedback! If interested, please take a few minutes to fill out the following Usability Study. Thank you for your time!

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community