<?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 find and export Object Classess from drawing in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/how-to-find-and-export-object-classess-from-drawing/m-p/5817534#M38657</link>
    <description>&lt;P&gt;Please realize that this forum is for vanilla AutoCAD .NET API discussion. If your question is specific for certain AutoCAD vertical product, other forum might provide better responds; or at least you give some information on what AutoCAD product your question is related to. I was guessing your question is about AutoCAD Map/Civil3D because of the mentioning of "class", but only was certain after seeing your following questions.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Anyway, here is my answer to your question.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;AutoCAD Map (Civil3D) come with .NET Map ObjectARX APIs, which covers APIs do manipulate classification data. So, you do not use SendCommand()/SendStringToExecute() to call an AutoCAD Map command. In the Map .NET API there is class called ClassificationManager, which you can use to find classified entities easily.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In order to use Map .NET API, you need to set reference to ManagedMapApi.dll. You can download AutoCAD Map ObjectARX SDK (not AutoCAD ObjectARX SDK), so that you can take llok at the documentation and sample code on how to use MAP .NET API (to deal with classification, map query, map data import/export...)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 15 Sep 2015 13:21:50 GMT</pubDate>
    <dc:creator>norman.yuan</dc:creator>
    <dc:date>2015-09-15T13:21:50Z</dc:date>
    <item>
      <title>How to find and export Object Classess from drawing</title>
      <link>https://forums.autodesk.com/t5/net-forum/how-to-find-and-export-object-classess-from-drawing/m-p/5814774#M38654</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can I &amp;nbsp;make report to excel from the drawing need to find all&amp;nbsp;&lt;SPAN&gt;Class name I have in the drawing and get name and length and export&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I use&amp;nbsp;&lt;SPAN&gt;Object Classess to draw line &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Sample &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Class name "4 Fiber"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Class name "12 Fiber"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Regards&lt;BR /&gt;Sgear&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 13 Sep 2015 16:23:01 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/how-to-find-and-export-object-classess-from-drawing/m-p/5814774#M38654</guid>
      <dc:creator>Sgear</dc:creator>
      <dc:date>2015-09-13T16:23:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to find and export Object Classess from drawing</title>
      <link>https://forums.autodesk.com/t5/net-forum/how-to-find-and-export-object-classess-from-drawing/m-p/5816773#M38655</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am finish fo find out how I can count how many line I have but I realy need the line Length and how I can select&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;the command work when I am finish but I need to select 4fiber before =&amp;nbsp;ThisDrawing.SendCommand("(command&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;anyone who can help me with this&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;         Dim pfSS As AcadSelectionSet
            Dim ssobject As AcadEntity


            Dim LineCount As Integer
            LineCount = 0
            Dim LineLength As Double
            LineLength = 0

            Dim AcApp As Autodesk.AutoCAD.Interop.AcadApplication = DirectCast(Autodesk.AutoCAD.ApplicationServices.Application.AcadApplication, Autodesk.AutoCAD.Interop.AcadApplication)
            Dim ThisDrawing As Autodesk.AutoCAD.Interop.AcadDocument = AcApp.ActiveDocument

            ThisDrawing.SendCommand("(command ""MAPSELECTCLASSIFIED"" ""4fiber"")" &amp;amp; vbCr)

            pfSS = ThisDrawing.PickfirstSelectionSet


            LineCount = LineCount + pfSS.Count

    
            For Each ssobject In pfSS



            Next ssobject

            '   pfSS.Highlight(True)

            MsgBox(LineCount)
            MsgBox(LineLength)

            pfSS.Delete()&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 14 Sep 2015 22:46:51 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/how-to-find-and-export-object-classess-from-drawing/m-p/5816773#M38655</guid>
      <dc:creator>Sgear</dc:creator>
      <dc:date>2015-09-14T22:46:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to find and export Object Classess from drawing</title>
      <link>https://forums.autodesk.com/t5/net-forum/how-to-find-and-export-object-classess-from-drawing/m-p/5816813#M38656</link>
      <description>&lt;P&gt;Finish to fix Line length&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;how can I select the Polyline in code is it the command&amp;nbsp;&lt;SPAN&gt;MAPSELECTCLASSIFIED ? or&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ThisDrawing.SendCommand "(command ""MAPSELECTCLASSIFIED"" 4fiber&amp;amp; vbCr&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;  Dim oEntline As AcadLWPolyline


         For Each oEnt In pfSS
                If TypeOf oEnt Is AcadLWPolyline Then

                    oEntline = oEnt
                    LineLength = LineLength + oEnt.Length
                End If
            Next oEnt&lt;/PRE&gt;</description>
      <pubDate>Mon, 14 Sep 2015 23:22:15 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/how-to-find-and-export-object-classess-from-drawing/m-p/5816813#M38656</guid>
      <dc:creator>Sgear</dc:creator>
      <dc:date>2015-09-14T23:22:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to find and export Object Classess from drawing</title>
      <link>https://forums.autodesk.com/t5/net-forum/how-to-find-and-export-object-classess-from-drawing/m-p/5817534#M38657</link>
      <description>&lt;P&gt;Please realize that this forum is for vanilla AutoCAD .NET API discussion. If your question is specific for certain AutoCAD vertical product, other forum might provide better responds; or at least you give some information on what AutoCAD product your question is related to. I was guessing your question is about AutoCAD Map/Civil3D because of the mentioning of "class", but only was certain after seeing your following questions.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Anyway, here is my answer to your question.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;AutoCAD Map (Civil3D) come with .NET Map ObjectARX APIs, which covers APIs do manipulate classification data. So, you do not use SendCommand()/SendStringToExecute() to call an AutoCAD Map command. In the Map .NET API there is class called ClassificationManager, which you can use to find classified entities easily.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In order to use Map .NET API, you need to set reference to ManagedMapApi.dll. You can download AutoCAD Map ObjectARX SDK (not AutoCAD ObjectARX SDK), so that you can take llok at the documentation and sample code on how to use MAP .NET API (to deal with classification, map query, map data import/export...)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Sep 2015 13:21:50 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/how-to-find-and-export-object-classess-from-drawing/m-p/5817534#M38657</guid>
      <dc:creator>norman.yuan</dc:creator>
      <dc:date>2015-09-15T13:21:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to find and export Object Classess from drawing</title>
      <link>https://forums.autodesk.com/t5/net-forum/how-to-find-and-export-object-classess-from-drawing/m-p/5818448#M38658</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks will check the&amp;nbsp;&lt;SPAN&gt;documentation and sample&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am using Autocad Map 2015 and Visual Studio Express 2013&amp;nbsp;Finish to get&amp;nbsp;&lt;SPAN&gt;Map ObjectARX SDK&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I am try to use the sample &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; &amp;nbsp;with out the form only get&amp;nbsp;No classified entity&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;      Dim errorCode As Classification.FeatureClassErrorCode = Classification.FeatureClassErrorCode.OK
        Try
            Dim colIds As ObjectIdCollection = Nothing
            Try
    
                Dim Getclass As String
                Getclass = "4fiber"

     
                colIds = m_ClassificationManager.GetClassifiedEntities(Getclass.ToString(), True)

            Catch e As System.Exception
                Utility.ShowMsg(vbNewLine &amp;amp; "No classified entity." &amp;amp; vbNewLine)
                Return
            End Try

            'Highlight the entities.
            Dim colId As ObjectId
            For Each colId In colIds
                HighLightEnt(True, colId)
            Next colId&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Sep 2015 21:00:44 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/how-to-find-and-export-object-classess-from-drawing/m-p/5818448#M38658</guid>
      <dc:creator>Sgear</dc:creator>
      <dc:date>2015-09-15T21:00:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to find and export Object Classess from drawing</title>
      <link>https://forums.autodesk.com/t5/net-forum/how-to-find-and-export-object-classess-from-drawing/m-p/5818483#M38659</link>
      <description>&lt;P&gt;It is really difficult to say why you did not get any entities back from call ClassificationManager.GetClassifiedEntities(string, bool) without seein gyour drawing file opened in AutoCAD Map.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However, from your first post, the class name seems "4 fiber", not "4fiber".&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You may call ClassificationManager.GetFeatureClassNames(), and loop through each class name to decide which one is the target class name.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Or you can call ClassificationManager.GetClassifiedEntities()&amp;nbsp; (the method that does not take any input parameter) to see if there is any entity returned.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Sep 2015 21:24:36 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/how-to-find-and-export-object-classess-from-drawing/m-p/5818483#M38659</guid>
      <dc:creator>norman.yuan</dc:creator>
      <dc:date>2015-09-15T21:24:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to find and export Object Classess from drawing</title>
      <link>https://forums.autodesk.com/t5/net-forum/how-to-find-and-export-object-classess-from-drawing/m-p/5824825#M38660</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks manage to get this to work&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;in the ClassificationVB sample&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was try to select all object class it hightlight but it only select the polyline I add last time not all&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Autodesk.AutoCAD.Internal.Utils.SelectObjects(ids)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;    Private Sub HighLightEnt(ByVal isHighLight As Boolean, ByVal objId As ObjectId)
            Dim IDNAME As Object
            IDNAME = 0
            Dim colIds As ObjectIdCollection = Nothing
            Dim subEntId As Autodesk.AutoCAD.DatabaseServices.SubentityId = New Autodesk.AutoCAD.DatabaseServices.SubentityId(SubentityType.Null, 0)
            Dim ids(1) As Autodesk.AutoCAD.DatabaseServices.ObjectId
            ids(0) = objId
            Dim path As Autodesk.AutoCAD.DatabaseServices.FullSubentityPath = New Autodesk.AutoCAD.DatabaseServices.FullSubentityPath(ids, subEntId)
            Dim ent As Entity = Nothing
            Dim trans As Transaction = Nothing
            Try
                trans = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.TransactionManager.StartTransaction()
                ent = trans.GetObject(objId, Autodesk.AutoCAD.DatabaseServices.OpenMode.ForRead)
                If Not ent Is Nothing Then
                    If isHighLight Then
                        ent.Highlight(path, True)
               
                        IDNAME = objId.ToString
                     
                        Utility.ShowMsg(IDNAME)

                        Autodesk.AutoCAD.Internal.Utils.SelectObjects(ids)

                    Else
                        ent.Unhighlight(path, True)
                    End If
                    trans.Commit()
                End If
            Catch
                Utility.ShowMsg(vbNewLine &amp;amp; "ObjectIdToObject Error")
            Finally
                trans.Dispose()
            End Try
        End Sub&lt;/PRE&gt;</description>
      <pubDate>Sun, 20 Sep 2015 16:56:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/how-to-find-and-export-object-classess-from-drawing/m-p/5824825#M38660</guid>
      <dc:creator>Sgear</dc:creator>
      <dc:date>2015-09-20T16:56:30Z</dc:date>
    </item>
  </channel>
</rss>

