So I take it you didn't no the answer. Don't post responses if you don't
have anything intelligent to say! I am already somewhat familiar with C#.
Just like the majority of people in this discussion group, I am trying to
get a better understanding of using C# with AutoCAD.
"J. Daniel Smith" wrote in message
news:4858917@discussion.autodesk.com...
You'll probably have more success "trying to learn C#" at places like
http://msdn.microsoft.com/vcsharp/gettingstarted/default.aspx; this
discussion group more-or-less assumes knowledge of a .NET language.
Dan
"Edward Merkins" wrote in message
news:4858845@discussion.autodesk.com...
I am trying to learn C# based on examples that I find in this discussion
group. With that said, based on the example below, I am receiving the error
message: The name 'acedCmd' does not exist in the class or namespace
'AcadTest01.CommandSample' Can someone help?
"Tony Tanzillo" wrote in message
news:4853121@discussion.autodesk.com...
They didn't expose it.
Give the following a go, and see what happens.
Note that the same exact rules that govern the use
of acedCommand() in native ObjectARX apply here
(namely, you can't use it from the Application context).
////////////////// CommandSample.cs ///////////////////
// Copyright (c)2005 Tony Tanzillo, all rights reserved
//
// Shows how to execute commands without resorting
// to the kludgy SendStringToExecute method.
//
// The command 'COMMANDTEST' draws a circle
// centered at 2,2,0 with a radius of 4.0 units.
using System;
using Autodesk.AutoCAD.DatabaseServices;
using Autodesk.AutoCAD.Geometry;
using AcadApp = Autodesk.AutoCAD.ApplicationServices.Application;
public class CommandSample
{
const Int32 RTREAL = 5001;
const Int32 RTSTR = 5005;
const Int32 RT3DPOINT = 5009;
[DllImport("acad.exe", CallingConvention = CallingConvention.Cdecl,
EntryPoint="acedCmd")]
extern static int acedCmd(IntPtr pResbuf);
unsafe static int Command(ResultBuffer args)
{
if( ! AcadApp.DocumentManager.IsApplicationContext )
return acedCmd((IntPtr) args.UnmanagedObject.ToPointer());
else
return 0;
}
[Autodesk.AutoCAD.Runtime.CommandMethod("COMMANDTEST")]
public static void CommandTest()
{
ResultBuffer args = new ResultBuffer();
args.Add(new TypedValue(RTSTR, "._circle"));
args.Add(new TypedValue(RT3DPOINT, new Point3d(2.0, 2.0, 0.0)));
args.Add(new TypedValue(RTREAL, 4.0));
Command(args);
}
}
--
http://www.caddzone.com
AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005/2006
http://www.acadxtabs.com
wrote in message news:4852689@discussion.autodesk.com...
What is the corresponding functions or classes for thesethe arx Global
function acedcommand in the .NET managed classes?