<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Select Point From Modal Form in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/select-point-from-modal-form/m-p/1350766#M84697</link>
    <description>What files do I need to have referenced for this Import&lt;BR /&gt;
&lt;BR /&gt;
Imports Autodesk.AutoCAD.EditorInput&lt;BR /&gt;
&lt;BR /&gt;
Also, I am on ABS2005 Do I need 2006 for this to work?</description>
    <pubDate>Fri, 10 Jun 2005 13:43:58 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2005-06-10T13:43:58Z</dc:date>
    <item>
      <title>Select Point From Modal Form</title>
      <link>https://forums.autodesk.com/t5/net-forum/select-point-from-modal-form/m-p/1350764#M84695</link>
      <description>Ahhh.. The dreaded modal form questions persist....&lt;BR /&gt;
&lt;BR /&gt;
I need to have a form displayed that does not allow the user to interact with AutoCAD while it is visible. But, when they click a button to select objects, a point or whatever, the form will disappear, roll up, whatever, allow the user to perform the action, then reappear. I seen other questions like this and the responses on how to handle it but I think .NET is different.&lt;BR /&gt;
&lt;BR /&gt;
Example:&lt;BR /&gt;
&lt;BR /&gt;
Public Class Commands&lt;BR /&gt;
&amp;lt;CommandMethod("MyCommand")&amp;gt; _&lt;BR /&gt;
Public Sub MyCommand ()&lt;BR /&gt;
&lt;BR /&gt;
Try&lt;BR /&gt;
Dim Fp As New Form&lt;BR /&gt;
&lt;BR /&gt;
Fp.ShowDialog()&lt;BR /&gt;
&lt;BR /&gt;
'if I hide the form at anytime while it is displayed&lt;BR /&gt;
'like when the user clicks a button to select a point&lt;BR /&gt;
'this next line is executed and an exception is thrown&lt;BR /&gt;
'saying: AutoCAD main window is invisible&lt;BR /&gt;
&lt;BR /&gt;
MessageBox.show("You picked point: " fp.InsertionPoint)&lt;BR /&gt;
&lt;BR /&gt;
Catch ex As Exception&lt;BR /&gt;
Throw ex&lt;BR /&gt;
&lt;BR /&gt;
End Try&lt;BR /&gt;
End Sub&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Public Class FormIP&lt;BR /&gt;
Public Insertionpoint As String&lt;BR /&gt;
&lt;BR /&gt;
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click&lt;BR /&gt;
Dim pt As Double()&lt;BR /&gt;
Me.Hide()&lt;BR /&gt;
&lt;BR /&gt;
AcadTlc.ActiveDrawing.Utility.GetPoint(pt, "Select a point: ")&lt;BR /&gt;
&lt;BR /&gt;
Insertionpoint = pt(0).ToString &amp;amp; ", " &amp;amp; pt(1).ToString&lt;BR /&gt;
&lt;BR /&gt;
Me.Show()&lt;BR /&gt;
&lt;BR /&gt;
End Sub&lt;BR /&gt;
End Class&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Any help would be greatly appreciated… Thanks in advance.</description>
      <pubDate>Fri, 10 Jun 2005 12:42:54 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/select-point-from-modal-form/m-p/1350764#M84695</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2005-06-10T12:42:54Z</dc:date>
    </item>
    <item>
      <title>Re: Select Point From Modal Form</title>
      <link>https://forums.autodesk.com/t5/net-forum/select-point-from-modal-form/m-p/1350765#M84696</link>
      <description>Imports Autodesk.AutoCAD.Runtime&lt;BR /&gt;
&lt;BR /&gt;
Public Class Class1&lt;BR /&gt;
&lt;BR /&gt;
    &amp;lt;CommandMethod("form1")&amp;gt; _&lt;BR /&gt;
    Public Sub form1()&lt;BR /&gt;
        Dim f1 As New Form1&lt;BR /&gt;
        f1.ShowDialog()&lt;BR /&gt;
    End Sub&lt;BR /&gt;
&lt;BR /&gt;
End Class&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
========================================================================&lt;BR /&gt;
&lt;BR /&gt;
Imports Autodesk.AutoCAD.DatabaseServices&lt;BR /&gt;
Imports DBTransMan = Autodesk.AutoCAD.DatabaseServices.TransactionManager&lt;BR /&gt;
Imports Autodesk.AutoCAD.EditorInput&lt;BR /&gt;
&lt;BR /&gt;
Public Class Form1&lt;BR /&gt;
&lt;BR /&gt;
    Inherits System.Windows.Forms.Form&lt;BR /&gt;
&lt;BR /&gt;
    Dim Pt1 As New PromptPointOptions("Start: ")&lt;BR /&gt;
    Dim Pt2 As New PromptPointOptions("End: ")&lt;BR /&gt;
    Dim Pt1Res As PromptPointResult&lt;BR /&gt;
    Dim Pt2Res As PromptPointResult&lt;BR /&gt;
&lt;BR /&gt;
    Public Function drawLine()&lt;BR /&gt;
        Dim db As Database = HostApplicationServices.WorkingDatabase&lt;BR /&gt;
        Dim tm As DBTransMan = db.TransactionManager&lt;BR /&gt;
        Dim myT As Transaction = tm.StartTransaction()&lt;BR /&gt;
        Dim ed As Editor = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor&lt;BR /&gt;
        Try&lt;BR /&gt;
            Pt1Res = ed.GetPoint(Pt1)&lt;BR /&gt;
            Pt2.BasePoint = Pt1Res.Value&lt;BR /&gt;
            Pt2.UseBasePoint = True&lt;BR /&gt;
            Pt2Res = ed.GetPoint(Pt2)&lt;BR /&gt;
            Dim line As New Line(Pt1Res.Value, Pt2Res.Value)&lt;BR /&gt;
            Dim bt As BlockTable = CType(tm.GetObject(db.BlockTableId, OpenMode.ForRead, False), BlockTable)&lt;BR /&gt;
            Dim btr As BlockTableRecord = CType(tm.GetObject(bt(BlockTableRecord.ModelSpace), OpenMode.ForWrite, False), BlockTableRecord)&lt;BR /&gt;
            btr.AppendEntity(line)&lt;BR /&gt;
            tm.AddNewlyCreatedDBObject(line, True)&lt;BR /&gt;
            myT.Commit()&lt;BR /&gt;
        Catch ex As Exception&lt;BR /&gt;
            myT.Abort()&lt;BR /&gt;
        Finally&lt;BR /&gt;
            myT.Dispose()&lt;BR /&gt;
        End Try&lt;BR /&gt;
    End Function&lt;BR /&gt;
&lt;BR /&gt;
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click&lt;BR /&gt;
        Me.Visible = False&lt;BR /&gt;
        Call drawLine()&lt;BR /&gt;
        Me.Visible = True&lt;BR /&gt;
        TextBox1.Text = Pt1Res.Value.ToString&lt;BR /&gt;
        TextBox2.Text = Pt2Res.Value.ToString&lt;BR /&gt;
    End Sub&lt;BR /&gt;
    &lt;BR /&gt;
End Class</description>
      <pubDate>Fri, 10 Jun 2005 13:27:22 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/select-point-from-modal-form/m-p/1350765#M84696</guid>
      <dc:creator>Mikko</dc:creator>
      <dc:date>2005-06-10T13:27:22Z</dc:date>
    </item>
    <item>
      <title>Re: Select Point From Modal Form</title>
      <link>https://forums.autodesk.com/t5/net-forum/select-point-from-modal-form/m-p/1350766#M84697</link>
      <description>What files do I need to have referenced for this Import&lt;BR /&gt;
&lt;BR /&gt;
Imports Autodesk.AutoCAD.EditorInput&lt;BR /&gt;
&lt;BR /&gt;
Also, I am on ABS2005 Do I need 2006 for this to work?</description>
      <pubDate>Fri, 10 Jun 2005 13:43:58 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/select-point-from-modal-form/m-p/1350766#M84697</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2005-06-10T13:43:58Z</dc:date>
    </item>
    <item>
      <title>Re: Select Point From Modal Form</title>
      <link>https://forums.autodesk.com/t5/net-forum/select-point-from-modal-form/m-p/1350767#M84698</link>
      <description>You need to reference both these:&lt;BR /&gt;
acdbmgd.dll and acmdg.dll found the your CAD root directory.&lt;BR /&gt;
I'm using 2006.  I don't have 2005 loaded at the moment.</description>
      <pubDate>Fri, 10 Jun 2005 13:49:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/select-point-from-modal-form/m-p/1350767#M84698</guid>
      <dc:creator>Mikko</dc:creator>
      <dc:date>2005-06-10T13:49:21Z</dc:date>
    </item>
  </channel>
</rss>

