Thanx for the reply.
Now, when i add this line
using.AutoCAD.Colors;
i got the next error.
***************************************************************************************************************************************
System.BadImageFormatException was unhandled
Message=No se puede cargar el archivo o ensamblado 'acdbmgd, Version=18.1.0.0, Culture=neutral, PublicKeyToken=null' ni una de sus dependencias. Se ha intentado cargar un programa con un formato incorrecto.
Source=DrivingAutoCAD
FileName=acdbmgd, Version=18.1.0.0, Culture=neutral, PublicKeyToken=null
FusionLog==== Información de estado anterior al enlace ===
LOG: Usuario = Juan-VAIO\Juan
LOG: DisplayName = acdbmgd, Version=18.1.0.0, Culture=neutral, PublicKeyToken=null
(Fully-specified)
LOG: Appbase = file:///C:/Trabajo/Palmatools/INECO/PEIF/Pruebas_VC2010/Prueba_AutoCAD/DrivingCAD/bin/Debug/
LOG: PrivatePath inicial = NULL
Ensamblado de llamada : DrivingAutoCAD, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null.
===
LOG: Este enlace empieza en el contexto de carga default.
LOG: Utilización del archivo de configuración de la aplicación: C:\Trabajo\Palmatools\INECO\PEIF\Pruebas_VC2010\Prueba_AutoCAD\DrivingCAD\bin\Debug\DrivingAutoCAD.vshost.exe.Config
LOG: Utilizando el archivo de configuración de host:
LOG: Utilizando el archivo de configuración del equipo en C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
LOG: La directiva no se está aplicando a la referencia en este momento (enlace de ensamblado privado, personalizado, parcial o basado en la ubicación).
LOG: Intento de descarga de la nueva dirección URL file:///C:/Trabajo/Palmatools/INECO/PEIF/Pruebas_VC2010/Prueba_AutoCAD/DrivingCAD/bin/Debug/acdbmgd.DLL.
ERR: Error al completar la instalación del ensamblado (hr = 0x8007000b). Finalizó la búsqueda.
StackTrace:
en DrivingAutoCAD.Form1.button1_Click(Object sender, EventArgs e)
en System.Windows.Forms.Control.OnClick(EventArgs e)
en System.Windows.Forms.Button.OnClick(EventArgs e)
en System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
en System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
en System.Windows.Forms.Control.WndProc(Message& m)
en System.Windows.Forms.ButtonBase.WndProc(Message& m)
en System.Windows.Forms.Button.WndProc(Message& m)
en System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
en System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
en System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
en System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
en System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
en System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
en System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
en System.Windows.Forms.Application.Run(Form mainForm)
en DrivingAutoCAD.Program.Main() en C:\Trabajo\Palmatools\INECO\PEIF\Pruebas_VC2010\Prueba_AutoCAD\DrivingCAD\Program.cs:línea 19
en System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
en System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
en Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
en System.Threading.ThreadHelper.ThreadStart_Context(Object state)
en System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
en System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
en System.Threading.ThreadHelper.ThreadStart()
InnerException:
*************************************************************************************************************************************************
Are there another way to do something like this, and that works?
int r = 255;
int g = 0;
int b = 0;
AcadLayer LY_Rutas = gbl_doc.Layers.Add("PruebaCAD");
LY_Rutas.TrueColor.SetRGB(r,g,b);
thanx again