Results 1 to 5 of 5

Thread: Error Messages when debugging

  1. #1
    Member
    Join Date
    2013-02
    Posts
    31
    Login to Give a bone
    0

    Default Error Messages when debugging

    Hello,

    when i'm debugging a new code the are sometimes error-messages like "eInvalidInput". And so are there more of these messages.
    Is there a list / explanation of waht these messages mean and where to look where the mistake is in the code?

    Greeting,

    Joop

  2. #2
    Administrator BlackBox's Avatar
    Join Date
    2009-11
    Posts
    5,719
    Login to Give a bone
    0

    Default Re: Error Messages when debugging

    I am unsure of a single (presumably up-to-date) list of all possible Exceptions; it's more likely that you use Object Browser to diagnose the calling Methods used in your project, and use either try + catch [+ finally] block with an appropriate user notification, or simply logic in your code.

    Since you haven't posted any code, one cannot know for sure, but the Exception you listed suggests that you called a Method with an invalid parameter. More information is needed.
    "How we think determines what we do, and what we do determines what we get."

    Sincpac C3D ~ Autodesk Exchange Apps

    Computer Specs:
    Dell Precision 3660, Core i9-12900K 5.2GHz, 64GB DDR5 RAM, PCIe 4.0 M.2 SSD (RAID 0), 16GB NVIDIA RTX A4000

  3. #3
    Administrator Ed Jobe's Avatar
    Join Date
    2000-11
    Location
    Turlock, CA
    Posts
    6,409
    Login to Give a bone
    0

    Default Re: Error Messages when debugging

    Those types of messages are ObjectARX constants. The .Net api just provides wrappers for many arx methods. For any particular method, see ObjectArx.chm in the sdk. Most likely, you supplied the wrong type to an argument, like BlackBox mentioned. For example, the method called for you to pass it an ObjectID, and you supplied it as a System.String.
    C:> ED WORKING....


    LinkedIn

  4. #4
    Woo! Hoo! my 1st post
    Join Date
    2013-03
    Posts
    1
    Login to Give a bone
    0

    Thumbs up Re: Error Messages when debugging

    Quote Originally Posted by ukemi72362725 View Post
    Hello,

    when i'm debugging a new code the are sometimes error-messages like "eInvalidInput". And so are there more of these messages.
    Is there a list / explanation of waht these messages mean and where to look where the mistake is in the code?

    Greeting,




    Joop
    Hi ukemi
    I am new bie here , Its my first time to post on this forum.... I also suffer the same problem that you have. Last timw when I'm debugging a new code then i have same message like eInvaidInput.... but after reading my code i know it's my mistake but it cause lot's of time....... I am new here so guys Please feel free to give me your comments, instructions............

  5. #5
    AUGI Addict fixo's Avatar
    Join Date
    2005-05
    Location
    Pietari, Venäjä
    Posts
    1,269
    Login to Give a bone
    0

    Default Re: Error Messages when debugging

    Hi susan.lee
    Welcome on board
    One possible and easy way is to use boolean variable
    for final information at the end of program, you may want to
    use instead other variables say one for particular action
    within your program, but then you have to display al of then
    in the screen or in the command line
    (I'm personally still avoid to use MsgBox)
    Give this a try:
    Code:
           <CommandMethod("tex")> _
            Public Shared Sub TestForExceptionMessages()
                'create variable to inform user about exception
                Dim what As Boolean = True
                ' create variable for informative string
                Dim result As String = String.Empty
                Dim doc As Document = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument
                Dim db As Database = doc.Database
                Dim ed As Editor = doc.Editor
    
                Dim peo As New PromptEntityOptions(vbLf & "Please, select a line: ")
                peo.SetRejectMessage(vbLf & "Not a line...")
                peo.AllowNone = False
                peo.AddAllowedClass(GetType(Line), True)
                Dim per As PromptEntityResult = ed.GetEntity(peo)
    
                If per.Status <> PromptStatus.OK Then
                    Return
                End If
    
                Dim ppo As New PromptPointOptions(vbLf & "Please, specify a point: ")
                ppo.AllowNone = True
                Dim tm As Autodesk.AutoCAD.ApplicationServices.TransactionManager = doc.TransactionManager
                'to force draw entity on screen
                tm.EnableGraphicsFlush(True)
                Using tr As Transaction = tm.StartTransaction()
                    'cast selected objec as line
                    Dim ln As Line = DirectCast(tr.GetObject(per.ObjectId, OpenMode.ForRead), Line)
                    Dim btr As BlockTableRecord = DirectCast(tr.GetObject(db.CurrentSpaceId, OpenMode.ForWrite), BlockTableRecord)
                    'create variable to count picked points
                    Dim pcount As Integer = 0
                    Dim id As ObjectId = ObjectId.Null
                    Try
                        While True
                            Dim ppr As PromptPointResult = ed.GetPoint(ppo)
                            If ppr.Status <> PromptStatus.OK Then
                                ed.WriteMessage(vbLf & "Inerrupted by user.")
                                Exit While
                            ElseIf ppr.Status = PromptStatus.OK Then
                                'count picked points
                                pcount += 1
                            End If
    
                            ppo.Message = vbLf & "Specify next point: "
    
                            Dim pt As Point3d = ppr.Value
    
                            Dim nl As New Line(pt, ln.EndPoint)
                            id = btr.AppendEntity(nl)
                            tm.AddNewlyCreatedDBObject(nl, True)
                            ' force to draw entity
                            tm.QueueForGraphicsFlush()
                            ' confirm force
                            tm.FlushGraphics()
                            ed.UpdateScreen()
                           
                        End While
                        ed.WriteMessage(vbLf & "Number of oints: {0}: " & vbLf, pcount)
                        ' gather all possible exceptions
                        If pcount < 1 Then what = False
                        ' build informative string, e.g.:
                        result = IIf(what = True, "Success", "Fail")
                        'catch autocad based exception
                    Catch ex As Autodesk.AutoCAD.Runtime.Exception
                        what = False
                        ed.WriteMessage(vbLf & ex.Message & vbLf & ex.StackTrace & vbLf)
                        'catch high level exception
                    Catch exsys As System.Exception
                        what = False
                        ed.WriteMessage(vbLf & exsys.Message & vbLf & exsys.StackTrace & vbLf)
                    Finally
                        ' commit transaction
                        tr.Commit()
                        ' inform user about how to program ended up with
                        ed.WriteMessage(vbLf & "Program ended up with result of ""{0}""" & vbLf, result)
                    End Try
                End Using
            End Sub
    So my recommendation is necessary to check each user input and each execution of individual commands
    in your program and report these results to the command line, then after a thorough check of this program
    you have remove some of them
    Last edited by fixo; 2013-03-24 at 01:54 PM.

Similar Threads

  1. Error Messages
    By clark.fillinger in forum AMEP General
    Replies: 2
    Last Post: 2010-02-25, 05:07 PM
  2. Error messages
    By dkriete in forum Revit Architecture - Families
    Replies: 1
    Last Post: 2009-10-01, 07:40 PM
  3. JIT Debugging Error Message
    By lonewolfjustin in forum AutoCAD General
    Replies: 3
    Last Post: 2008-10-23, 06:52 PM
  4. Error Messages
    By DanielleAnderson in forum Revit Architecture - Wish List
    Replies: 6
    Last Post: 2005-12-14, 07:31 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •