Temporary Graphic lines using .NET programming

Hi!

I would like to know how will I programmatically draw a temporary graphic lines in Edit Window using .NET programming. 

Sample code will be very much helpful.

Thank you.

Comments

  • you can p/invoke sds_grdraw example

     

     

    [assembly: CommandClass(typeof(BcadMgdTest.Commands))]namespace  BcadMgdTest{ public class Commands{ //needs using System.Runtime.InteropServices;[DllImport("Bricscad.exe", CallingConvention = CallingConvention.Cdecl)] static internal extern int sds_grdraw(double[] startPoint, double[] endPoint, int color, int hightlight); //needs using Teigha.Runtime;[CommandMethod("doit")] public static void doit(){ sds_grdraw(new double[] { 0.0, 0.0, 0.0 }, new double[] { 100.0, 100.0, 0.0 }, 6, 0);}}}
  • [assembly: CommandClass(typeof(BcadMgdTest.Commands))]
    namespace BcadMgdTest
    {
      public class Commands
      {
        //needs using System.Runtime.InteropServices;
        [DllImport("Bricscad.exe", CallingConvention = CallingConvention.Cdecl)]
        static internal extern int sds_grdraw(double[] startPoint, double[] endPoint, int color, int hightlight);
        //needs using Teigha.Runtime;
        [CommandMethod("doit")]
        public static void doit()
        {
          sds_grdraw(new double[] { 0.0, 0.0, 0.0 }, new double[] { 100.0, 100.0, 0.0 }, 6, 0);
        }
      }
    }
  • Daniel,

    Thank you the codes. it worked! Though my requirements is in VB.NET I was able to convert it.

    Thanks again.

     

     

    <DllImport(

    "Bricscad.exe", CallingConvention:=CallingConvention.Cdecl)> _

    Private Shared Sub sds_grdraw(ByVal startPoint() As Double, ByVal endPoint() As Double, ByVal color As Integer, ByVal highlight As Integer)

    End Sub

     

     

This discussion has been closed.