AutoCAD Map 3D Developer
Welcome to Autodesk’s AutoCAD Map 3D Developer Forums. Share your knowledge, ask questions, and explore popular AutoCAD Map 3D Developer topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

DxfCode.Operator doesn't exist for Autodesk Map?

1 REPLY 1
Reply
Message 1 of 2
swagues
422 Views, 1 Reply

DxfCode.Operator doesn't exist for Autodesk Map?

So, I'm trying to build a filter to select all text in a document, but the version of

Autodesk.AutoCAD.DatabaseServices.DxfCode that comes with Autodesk Map doesn't seem to have the Operator code included in it.

 

How do I access operators with Autodesk Map?

 

 

1 REPLY 1
Message 2 of 2
fieldguy
in reply to: swagues

I might be missing something here.  This method from Hallex in the .net forum selects all text.  This is generic autocad - not specific to any vertical product (Autodesk.AutoCad.EditorInput namespace in the accoremgd assembly).

 

    ' Imports System.Collections.Specialized
    Private Function ExtractText() As StringCollection
        Dim txtcoll As New StringCollection
        Dim doc As Document = Application.DocumentManager.MdiActiveDocument()
        Dim db As Database = doc.Database
        Dim ed As Editor = doc.Editor
        Try
            Using tr As Transaction = db.TransactionManager.StartTransaction
                Dim res As PromptSelectionResult
                Dim filterList(,) As Object = New Object(,) {{-4, "<or"}, {0, "text"}, {0, "mtext"}, {-4, "or>"}} '' etc
                Dim tvs(filterList.GetUpperBound(0)) As TypedValue
                For i As Integer = 0 To filterList.GetUpperBound(0)
                    tvs(i) = New TypedValue(Convert.ToInt32(filterList(i, 0)), filterList(i, 1))
                Next
                Dim filt As SelectionFilter = New SelectionFilter(tvs)
                res = ed.SelectAll(filt)
                If res.Status <> PromptStatus.OK Then
                    Return Nothing
                End If
                For Each sobj As SelectedObject In res.Value
                    Dim ent As Entity = tr.GetObject(sobj.ObjectId, OpenMode.ForRead)
                    Dim txt As DBText = TryCast(ent, DBText)
                    If txt IsNot Nothing Then
                        txtcoll.Add(txt.TextString)
                    End If
                    Dim mtxt As MText = TryCast(ent, MText)
                    If mtxt IsNot Nothing Then
                        txtcoll.Add(mtxt.Contents)
                    End If
                Next
            End Using
        Catch exs As System.Exception
            ed.WriteMessage(exs.Message & vbLf & exs.StackTrace)
            Return Nothing
        Finally

        End Try
        Return txtcoll
    End Function

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost