Results 1 to 4 of 4

Thread: COMException Error in AcadDoc.Utility

  1. #1
    100 Club
    Join Date
    2011-08
    Location
    Vadodara, India
    Posts
    147
    Login to Give a bone
    0

    Default COMException Error in AcadDoc.Utility

    Hi!

    I received an error while running codes.

    please help.

    Avinash
    Attached Images Attached Images

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

    Default Re: COMException Error in AcadDoc.Utility

    You can't create an instance of the Utility class. Besides, you're not saving much typing by assigning it to a variable. In fact you're just taking up more memory for the variable. Why not just use AcadDoc.Utility to call one of the methods? If you still want to use it, include it in your Imports statements

    Imports AcadUtil = Autodesk.AutoCAD.Interop.AcadDocument.Utility
    Last edited by Ed Jobe; 2017-07-19 at 02:34 PM.
    C:> ED WORKING....

  3. #3
    100 Club
    Join Date
    2011-08
    Location
    Vadodara, India
    Posts
    147
    Login to Give a bone
    0

    Default Re: COMException Error in AcadDoc.Utility

    I was doing as per your said "AcadDoc.Utility" but still it give same error but location is different at " Pt1 = AcadDoc.Utility.PolarPoint(AngPnt, South, (15 + 4))"

    Please suggest better option

    - - - Updated - - -

    I am using AutoCAD 2012 64Bit with Visual Studio 2015.

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

    Default Re: COMException Error in AcadDoc.Utility

    Is VBA working? Can you enter VBAIDE at the command line? I can't remember, but at one point vba was still 32bit. I think it was in 2014 that vba was upgraded to version 7/64bit. If vba is installed and working, but is 32bit, you won't be able to call COM objects from 64bit.

    Here's a replacement function I got from the swamp.
    Code:
    Private Function polarpoint(ByVal basept As Point3d, ByVal angle As Double, ByVal distance As Double) As Point3d
            Return New Point3d(basept.X + (distance * Math.Cos(angle)), _
                    basept.Y + (distance * Math.Sin(angle)), _
                    basept.Z)
        End Function
    Last edited by Ed Jobe; 2017-07-21 at 03:35 PM.
    C:> ED WORKING....

Similar Threads

  1. Replies: 2
    Last Post: 2016-09-20, 02:10 PM
  2. Replies: 0
    Last Post: 2015-08-07, 05:37 PM
  3. ACADDOC.LSP error trapping
    By jasonp in forum AutoLISP
    Replies: 3
    Last Post: 2014-03-18, 05:43 PM
  4. ACADDOC.LSP
    By dbrownson in forum AutoLISP
    Replies: 20
    Last Post: 2008-02-06, 04:52 AM
  5. Replies: 2
    Last Post: 2007-01-25, 09:56 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
  •