Editor.Command - does not exist?

Hello,
I'm trying to write my application that works well in AutoCAD for the BricsCAD.
Till now, I don't have much problems, but I came across to the Editor.Command void.

Does anyone know, how can I send specify command to the BricsCAD? Like d.Command("FILEDIA", "0") ?
Thanks.

Comments

  • FILEDIA is a system variable, so you can directly access variables from NET, without command interface :-)

    As far as I know, sending commands should not be a problem in our NET interface ?
    You might send us a support request, with a sample project, so our developers can adjust + improve that,
    and/or adjust and improve our NET implementation

    many greetings !
  •  FILEDIA was just an example :)

    Here is little more advanced function which invoke standard BREAK command, but user have to only once select point to break:

    [code]
     Document doc = Application.DocumentManager.MdiActiveDocument;
                Database db = doc.Database;
                Editor ed = doc.Editor;
                PromptEntityOptions peo = new PromptEntityOptions("\nChoose line to break: ");
                peo.SetRejectMessage("Tylko linia albo polilinia.");
                peo.AddAllowedClass(typeof(Curve), false);
                PromptEntityResult per = ed.GetEntity(peo);
                if (per.Status != PromptStatus.OK) return;
                ObjectId curveId = per.ObjectId;
                PromptPointResult ppr = ed.GetPoint("\nSelect point where to break: ");
                if (ppr.Status != PromptStatus.OK) return;
                Point3d breakPoint = ppr.Value;
                ed.Command("_.break", curveId, "_first", breakPoint, breakPoint);
    [/code]

    In old version (ACAD 2007) I have to do this like below:
    [code]
                Document doc = Application.DocumentManager.MdiActiveDocument;
                Editor ed = doc.Editor;
                Database db = doc.Database;

                PromptEntityOptions peo = new PromptEntityOptions("\nWybierz obiekt do rozbicia");
                PromptEntityResult per = ed.GetEntity(peo);

                if (per.Status != PromptStatus.OK)
                    return;

                PromptPointOptions ppo = new PromptPointOptions("\nWskaż punkt rozbicia");
                PromptPointResult ppr = ed.GetPoint(ppo);

                if (ppr.Status != PromptStatus.OK)
                    return;

                Point3d first = ppr.Value;

                ResultBuffer rb = new ResultBuffer();
                rb.Add(new TypedValue(5005, "BREAK"));
                rb.Add(new TypedValue((int)LispDataType.ObjectId, per.ObjectId));
                rb.Add(new TypedValue(5005, ""));
                rb.Add(new TypedValue(5005, "F"));
                rb.Add(new TypedValue(5005, string.Format("{0},{1},{2}", first.X, first.Y, first.Z)));
                rb.Add(new TypedValue(5005, string.Format("{0},{1},{2}", first.X, first.Y, first.Z)));

                Utilities.acedCmd(rb.UnmanagedObject);
    [/code]



  •  Anyone know why acedCmd doesn't work for me (BCAD v16):

    [code] [DllImport("Brx16.DLL", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Unicode)]
    public extern static int acedCmd(System.IntPtr vlist);[/code]
  • Hi, its better to use static bool Bricscad.Global.Editor.Command(ResultBuffer args), which wraps acedCmd

    Cheers :)

  • Exactly what I was looking for! I did not managed to hide my excitement :) Cheers! 
This discussion has been closed.

Howdy, Stranger!

It looks like you're new here. Click one of the buttons on the top bar to get involved!