Converting Double() to AcadPoint in VB .net

I am working in VB .net and I need to covert the Double(0 to 2) to AcadPoint and voceversaHow can I do this?thanks

Comments

  • AcadPoint is not an array, it’s a Point Object, like AcadLine etc…Converted from C#

    _Public Shared Sub Cast() Dim app As AcadApplication = TryCast(Application.AcadApplication,AcadApplication) If (app Is Nothing) Then Throw New Exception("Could Not Get Application") End If Dim doc As AcadDocument = app.ActiveDocument Dim db As AcadDatabase = doc.database Dim apt As Double() = New Double() { 100, 100, 100 } Dim pt As Double() = TryCast(db.ModelSpace.AddPoint(apt).Coordinates,Double()) doc.Utility.Prompt(String.Format(ChrW(10) & "{0}, {1}, {2}", pt(0), pt(1), pt(2)))End Sub
  • seems the editor does not line some vb symbolshere it is in C#

    [CommandMethod("Cast")]public static void Cast(){ AcadApplication app = Application.AcadApplication as AcadApplication; if (app == null) { throw new Exception("Could Not Get Application"); } AcadDocument doc = app.ActiveDocument; AcadDatabase db = doc.database; double[] apt = new double[] { 100.0, 100.0, 100.0 }; double[] pt = db.ModelSpace.AddPoint(apt).Coordinates as double[]; doc.Utility.Prompt(string.Format("\n{0}, {1}, {2}", pt[0], pt[1], pt[2]));}
This discussion has been closed.