<?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: Retrieve the Geometrical data from AutoCad Objects... in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/retrieve-the-geometrical-data-from-autocad-objects/m-p/1347854#M84731</link>
    <description>Thanks I'll try that sample!&lt;BR /&gt;
Do you now any way of getting the geometrical data for objects...&lt;BR /&gt;
At this point all want to accomplish is to retrieve the polygon points that all objects in an dwg-file. Maybe it's not an arx I should do for this purpose...</description>
    <pubDate>Thu, 09 Jun 2005 08:36:09 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2005-06-09T08:36:09Z</dc:date>
    <item>
      <title>Retrieve the Geometrical data from AutoCad Objects...</title>
      <link>https://forums.autodesk.com/t5/net-forum/retrieve-the-geometrical-data-from-autocad-objects/m-p/1347852#M84729</link>
      <description>I've made some arx-programs for AutoCad 2002 so I'm not really new in this &lt;BR /&gt;
topic. My first goal for my first ".NET-ARX" in C# is to traverse the &lt;BR /&gt;
current document and retrieve all objects geometrical data, no matter which &lt;BR /&gt;
type they are. Do you now any way of getting the geometrical data form the &lt;BR /&gt;
objects in C#.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
If you have any tip of where to expand my knowledge in ".NET-ARX" I'm really &lt;BR /&gt;
grateful...</description>
      <pubDate>Wed, 08 Jun 2005 08:46:51 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/retrieve-the-geometrical-data-from-autocad-objects/m-p/1347852#M84729</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2005-06-08T08:46:51Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieve the Geometrical data from AutoCad Objects...</title>
      <link>https://forums.autodesk.com/t5/net-forum/retrieve-the-geometrical-data-from-autocad-objects/m-p/1347853#M84730</link>
      <description>Here is some vb code that selects objects then filters out the text &amp;amp; &lt;BR /&gt;
circles. It should give you an idea of how to get the data you are after &lt;BR /&gt;
using C#&lt;BR /&gt;
&lt;BR /&gt;
Public Sub GetAll()&lt;BR /&gt;
&lt;BR /&gt;
Dim ed As Editor = Application.DocumentManager.MdiActiveDocument.Editor&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
'Set the selection options&lt;BR /&gt;
&lt;BR /&gt;
Dim SelOpts As New PromptSelectionOptions&lt;BR /&gt;
&lt;BR /&gt;
SelOpts.MessageForAdding = "Select Objects:"&lt;BR /&gt;
&lt;BR /&gt;
SelOpts.AllowDuplicates = True&lt;BR /&gt;
&lt;BR /&gt;
'Make the selection:&lt;BR /&gt;
&lt;BR /&gt;
Dim res As PromptSelectionResult = ed.GetSelection()&lt;BR /&gt;
&lt;BR /&gt;
If Not res.Status = PromptStatus.OK Then Return&lt;BR /&gt;
&lt;BR /&gt;
Dim SS As Autodesk.AutoCAD.EditorInput.SelectionSet = res.Value&lt;BR /&gt;
&lt;BR /&gt;
Dim idarray As ObjectId() = SS.GetObjectIds()&lt;BR /&gt;
&lt;BR /&gt;
Dim db As Database = Application.DocumentManager.MdiActiveDocument.Database&lt;BR /&gt;
&lt;BR /&gt;
Dim tm As Autodesk.AutoCAD.DatabaseServices.TransactionManager = &lt;BR /&gt;
db.TransactionManager&lt;BR /&gt;
&lt;BR /&gt;
'start a transaction&lt;BR /&gt;
&lt;BR /&gt;
Dim myT As Transaction = tm.StartTransaction()&lt;BR /&gt;
&lt;BR /&gt;
Try&lt;BR /&gt;
&lt;BR /&gt;
Dim id As ObjectId&lt;BR /&gt;
&lt;BR /&gt;
For Each id In idarray&lt;BR /&gt;
&lt;BR /&gt;
Dim entity As Entity = tm.GetObject(id, OpenMode.ForRead, True)&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
If TypeOf entity Is Autodesk.AutoCAD.DatabaseServices.DBText Then&lt;BR /&gt;
&lt;BR /&gt;
' DBTEXT Origin = bottom left&lt;BR /&gt;
&lt;BR /&gt;
TextBox1.Text += "DBTEXT FOUND " &amp;amp; vbCrLf&lt;BR /&gt;
&lt;BR /&gt;
Dim Txt As Autodesk.AutoCAD.DatabaseServices.DBText = entity&lt;BR /&gt;
&lt;BR /&gt;
Dim k&lt;BR /&gt;
&lt;BR /&gt;
TxtFound = TxtFound + 1&lt;BR /&gt;
&lt;BR /&gt;
k = Txt.TextString&lt;BR /&gt;
&lt;BR /&gt;
TextBox1.Text += "STRING " &amp;amp; k.ToString &amp;amp; vbCrLf&lt;BR /&gt;
&lt;BR /&gt;
TextFnd(1, TxtFound) = k.tostring&lt;BR /&gt;
&lt;BR /&gt;
k = Txt.Position&lt;BR /&gt;
&lt;BR /&gt;
TextBox1.Text += "POSITION " &amp;amp; vbCrLf &amp;amp; k.ToString &amp;amp; vbCrLf &amp;amp; vbCrLf&lt;BR /&gt;
&lt;BR /&gt;
Dim Spl&lt;BR /&gt;
&lt;BR /&gt;
Spl = Mid(k.tostring, 2, Len(k.tostring) - 2)&lt;BR /&gt;
&lt;BR /&gt;
TextBox1.Text += "SPLIT" &amp;amp; Spl &amp;amp; vbCrLf&lt;BR /&gt;
&lt;BR /&gt;
Dim sa() As String&lt;BR /&gt;
&lt;BR /&gt;
sa = Split(Spl, ",", -1)&lt;BR /&gt;
&lt;BR /&gt;
TextFnd(0, TxtFound) = TxtFound&lt;BR /&gt;
&lt;BR /&gt;
TextFnd(2, TxtFound) = sa(0)&lt;BR /&gt;
&lt;BR /&gt;
TextFnd(3, TxtFound) = sa(1)&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
End If&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
If TypeOf entity Is Autodesk.AutoCAD.DatabaseServices.MText Then&lt;BR /&gt;
&lt;BR /&gt;
TextBox1.Text += "*MTEXT FOUND " &amp;amp; vbCrLf&lt;BR /&gt;
&lt;BR /&gt;
Dim Txt As Autodesk.AutoCAD.DatabaseServices.MText = entity&lt;BR /&gt;
&lt;BR /&gt;
TxtFound = TxtFound + 1&lt;BR /&gt;
&lt;BR /&gt;
Dim k&lt;BR /&gt;
&lt;BR /&gt;
'k = Txt.Id&lt;BR /&gt;
&lt;BR /&gt;
'TextBox1.Text += "ID " &amp;amp; k.ToString &amp;amp; vbCrLf&lt;BR /&gt;
&lt;BR /&gt;
k = Txt.Contents&lt;BR /&gt;
&lt;BR /&gt;
TextBox1.Text += "Contents " &amp;amp; k.ToString &amp;amp; vbCrLf &amp;amp; vbCrLf&lt;BR /&gt;
&lt;BR /&gt;
TextFnd(1, TxtFound) = k.tostring&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
k = Txt.Location&lt;BR /&gt;
&lt;BR /&gt;
TextBox1.Text += "Location " &amp;amp; k.ToString &amp;amp; vbCrLf&lt;BR /&gt;
&lt;BR /&gt;
Dim Spl&lt;BR /&gt;
&lt;BR /&gt;
Spl = Mid(k.tostring, 2, Len(k.tostring) - 2)&lt;BR /&gt;
&lt;BR /&gt;
TextBox1.Text += "SPLIT" &amp;amp; Spl &amp;amp; vbCrLf&lt;BR /&gt;
&lt;BR /&gt;
Dim sa() As String&lt;BR /&gt;
&lt;BR /&gt;
sa = Split(Spl, ",", -1)&lt;BR /&gt;
&lt;BR /&gt;
TextFnd(0, TxtFound) = TxtFound&lt;BR /&gt;
&lt;BR /&gt;
TextFnd(2, TxtFound) = sa(0)&lt;BR /&gt;
&lt;BR /&gt;
TextFnd(3, TxtFound) = sa(1)&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
End If&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
If TypeOf entity Is Autodesk.AutoCAD.DatabaseServices.Circle Then&lt;BR /&gt;
&lt;BR /&gt;
TextBox1.Text += "CIRCLE FOUND " &amp;amp; vbCrLf&lt;BR /&gt;
&lt;BR /&gt;
Dim Circ As Autodesk.AutoCAD.DatabaseServices.Circle = entity&lt;BR /&gt;
&lt;BR /&gt;
Dim k&lt;BR /&gt;
&lt;BR /&gt;
k = Circ.Center&lt;BR /&gt;
&lt;BR /&gt;
ed.WriteMessage((ControlChars.Lf + "CENT " &amp;amp; k.ToString))&lt;BR /&gt;
&lt;BR /&gt;
TextBox1.Text += "Centre " &amp;amp; k.ToString &amp;amp; vbCrLf &amp;amp; vbCrLf&lt;BR /&gt;
&lt;BR /&gt;
Dim Spl&lt;BR /&gt;
&lt;BR /&gt;
Spl = Mid(k.tostring, 2, Len(k.tostring) - 2)&lt;BR /&gt;
&lt;BR /&gt;
TextBox1.Text += "SPLIT" &amp;amp; Spl &amp;amp; vbCrLf&lt;BR /&gt;
&lt;BR /&gt;
Dim sa() As String&lt;BR /&gt;
&lt;BR /&gt;
sa = Split(Spl, ",", -1)&lt;BR /&gt;
&lt;BR /&gt;
CircFound = CircFound + 1&lt;BR /&gt;
&lt;BR /&gt;
CircCen(0, CircFound) = CircFound&lt;BR /&gt;
&lt;BR /&gt;
CircCen(1, CircFound) = sa(0)&lt;BR /&gt;
&lt;BR /&gt;
CircCen(2, CircFound) = sa(1)&lt;BR /&gt;
&lt;BR /&gt;
End If&lt;BR /&gt;
&lt;BR /&gt;
Next id&lt;BR /&gt;
&lt;BR /&gt;
Finally&lt;BR /&gt;
&lt;BR /&gt;
myT.Dispose()&lt;BR /&gt;
&lt;BR /&gt;
End Try&lt;BR /&gt;
&lt;BR /&gt;
TextBox1.Text += "Text " &amp;amp; TxtFound &amp;amp; vbCrLf&lt;BR /&gt;
&lt;BR /&gt;
TextBox1.Text += "Circles " &amp;amp; CircFound &amp;amp; vbCrLf&lt;BR /&gt;
&lt;BR /&gt;
End Sub&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
"Anders Pettersson" &lt;ANDERS.PETTERSSON&gt; wrote in message &lt;BR /&gt;
news:4868384@discussion.autodesk.com...&lt;BR /&gt;
I've made some arx-programs for AutoCad 2002 so I'm not really new in this&lt;BR /&gt;
topic. My first goal for my first ".NET-ARX" in C# is to traverse the&lt;BR /&gt;
current document and retrieve all objects geometrical data, no matter which&lt;BR /&gt;
type they are. Do you now any way of getting the geometrical data form the&lt;BR /&gt;
objects in C#.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
If you have any tip of where to expand my knowledge in ".NET-ARX" I'm really&lt;BR /&gt;
grateful...&lt;/ANDERS.PETTERSSON&gt;</description>
      <pubDate>Wed, 08 Jun 2005 12:25:19 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/retrieve-the-geometrical-data-from-autocad-objects/m-p/1347853#M84730</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2005-06-08T12:25:19Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieve the Geometrical data from AutoCad Objects...</title>
      <link>https://forums.autodesk.com/t5/net-forum/retrieve-the-geometrical-data-from-autocad-objects/m-p/1347854#M84731</link>
      <description>Thanks I'll try that sample!&lt;BR /&gt;
Do you now any way of getting the geometrical data for objects...&lt;BR /&gt;
At this point all want to accomplish is to retrieve the polygon points that all objects in an dwg-file. Maybe it's not an arx I should do for this purpose...</description>
      <pubDate>Thu, 09 Jun 2005 08:36:09 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/retrieve-the-geometrical-data-from-autocad-objects/m-p/1347854#M84731</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2005-06-09T08:36:09Z</dc:date>
    </item>
  </channel>
</rss>

