<?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: How to take size(width, hight) by event click in autocad in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/how-to-take-size-width-hight-by-event-click-in-autocad/m-p/4598453#M47104</link>
    <description>&lt;P&gt;Thanks very much&lt;/P&gt;</description>
    <pubDate>Thu, 07 Nov 2013 02:47:47 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2013-11-07T02:47:47Z</dc:date>
    <item>
      <title>How to take size(width, hight) by event click in autocad</title>
      <link>https://forums.autodesk.com/t5/net-forum/how-to-take-size-width-hight-by-event-click-in-autocad/m-p/4591127#M47101</link>
      <description>&lt;P&gt;Hello Everyone,&lt;/P&gt;&lt;P&gt;Everyone can help me. How can i take size(width, hight) of rectangle in file autocad when i click it. And then will show this information on form in vb.net. I hope everyone can help me. Thanks very much.&lt;/P&gt;</description>
      <pubDate>Tue, 05 Nov 2013 10:14:23 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/how-to-take-size-width-hight-by-event-click-in-autocad/m-p/4591127#M47101</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-11-05T10:14:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to take size(width, hight) by event click in autocad</title>
      <link>https://forums.autodesk.com/t5/net-forum/how-to-take-size-width-hight-by-event-click-in-autocad/m-p/4594099#M47102</link>
      <description>&lt;P&gt;is this difficult matter?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Nov 2013 01:45:29 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/how-to-take-size-width-hight-by-event-click-in-autocad/m-p/4594099#M47102</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-11-06T01:45:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to take size(width, hight) by event click in autocad</title>
      <link>https://forums.autodesk.com/t5/net-forum/how-to-take-size-width-hight-by-event-click-in-autocad/m-p/4596849#M47103</link>
      <description>&lt;P&gt;Hi ,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;With below code you can start to select a rectange and afterwards get length and width of that. Here I have create a message box to show length and width of a rectangle. I hope you can start with this code and later customize your requirement.&lt;/P&gt;&lt;PRE&gt; &amp;lt;CommandMethod("TST")&amp;gt; Public Sub RectangleSize()
        Dim doc As Document = Application.DocumentManager.MdiActiveDocument
        Dim db As Database = doc.Database
        Dim ed As Editor = doc.Editor
        Dim _length As Double = Nothing
        Dim _area As Double = Nothing
        Dim _width As Double = Nothing
        Dim peo As PromptEntityOptions = New PromptEntityOptions(vbLf &amp;amp; "Please select a rectangle:")
        Dim per As PromptEntityResult = ed.GetEntity(peo)
        If per.Status &amp;lt;&amp;gt; PromptStatus.OK Then
            Return
        End If
        Using tx As Transaction = db.TransactionManager.StartTransaction()
            Dim ent As Entity = tx.GetObject(per.ObjectId, OpenMode.ForRead)
            If TypeOf ent Is Polyline Then
                Dim pl As Polyline = TryCast(ent, Polyline)
                If pl.Closed Then
                    Dim pt1 As Point2d = pl.GetPoint2dAt(0)
                    Dim pt2 As Point2d = pl.GetPoint2dAt(1)
                    Dim pt3 As Point2d = pl.GetPoint2dAt(2)
                    Dim distance1 As Double = pt1.GetDistanceTo(pt2)
                    distance1 = Math.Abs(distance1)
                    Dim distance2 As Double = pt2.GetDistanceTo(pt3)
                    distance2 = Math.Abs(distance2)
                    If distance1 &amp;gt; distance2 Then
                        _length = distance1
                    Else
                        _length = distance2
                    End If
                    _area = pl.Area
                    _width = _area / _length
                    MsgBox(_length &amp;amp; vbTab &amp;amp; _width)
                End If
            End If
            tx.Commit()
        End Using
    End Sub&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Nov 2013 14:25:23 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/how-to-take-size-width-hight-by-event-click-in-autocad/m-p/4596849#M47103</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-11-06T14:25:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to take size(width, hight) by event click in autocad</title>
      <link>https://forums.autodesk.com/t5/net-forum/how-to-take-size-width-hight-by-event-click-in-autocad/m-p/4598453#M47104</link>
      <description>&lt;P&gt;Thanks very much&lt;/P&gt;</description>
      <pubDate>Thu, 07 Nov 2013 02:47:47 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/how-to-take-size-width-hight-by-event-click-in-autocad/m-p/4598453#M47104</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-11-07T02:47:47Z</dc:date>
    </item>
  </channel>
</rss>

