error

Discussion in 'AutoCAD' started by Louis, Jul 19, 2004.

  1. Louis

    Louis Guest

    i am tring to use vla-InsertBlock to insert a block in a program that was
    working fine using "command" "insert". Without lecturing me on why i
    shouldn't change it if it was working could someone shed some light on the
    error?

    the error is: INTERNAL ERROR:
    !U:\global\src\ObjectDbx\DB\IMP\src\dbutil.cpp@843: eLockViolation

    it always works the first time then lock the second. i suspect it's
    something obvious if i knew what i was doing.
     
    Louis, Jul 19, 2004
    #1
  2. Louis

    ECCAD Guest

    Without seeing the rest of the code - just guessing.
    Did you 'release' the object ?

    Bob
     
    ECCAD, Jul 19, 2004
    #2
  3. Louis

    Louis Guest

    i suspect if i can figure out how i am supposed to release the object then
    this will be solved, but so far i haven't had any luck. here is the insert
    i am trying to use, (also why when i search help for vla-InsertBlock
    nothing is found?)

    is there some command you have to do to end the command?

    (vl-load-com)
    (vla-InsertBlock
    (vla-get-ModelSpace
    (vla-get-ActiveDocument
    (vlax-get-acad-object)
    )
    )
    (vlax-3d-point InsPnt)
    BlockName
    1 1 1 0
    )
     
    Louis, Jul 20, 2004
    #3
  4. Louis

    Don Butler Guest

    (defun c:prac (/ ins)
    (vl-load-com)
    (setq inspnt (list 0.0 0.0 0.0))
    (setq ins
    (vla-InsertBlock
    (vla-get-ModelSpace
    (vla-get-ActiveDocument
    (vlax-get-acad-object)
    )
    )
    (vlax-3d-point InsPnt)
    "cutsht"
    1 1 1 0
    )
    )
    )

    This works fine here. Localized the Insert object.

    Or...

    (defun c:prac2 ()
    (vl-load-com)
    (setq inspnt (list 0.0 0.0 0.0))
    (vlax-release-object
    (vla-InsertBlock
    (vla-get-ModelSpace
    (vla-get-ActiveDocument
    (vlax-get-acad-object)
    )
    )
    (vlax-3d-point InsPnt)
    "cutsht"
    1 1 1 0
    )
    )
    )

    Don
     
    Don Butler, Jul 20, 2004
    #4
  5. Louis

    ECCAD Guest

    (if (not (vlax-object-released-p YourObject))
    (vlax-release-object YourObject)
    )
    (gc)

    Bob
     
    ECCAD, Jul 20, 2004
    #5
  6. Louis

    Don Butler Guest

    I believe that if it is declared as a LOCAL symbol it is not necessary to
    release it.

    If I am wrong maybe someone will let me know.

    Don
     
    Don Butler, Jul 20, 2004
    #6
  7. Louis

    ECCAD Guest

    I think the 'ins', being local is just a 'symbol' - which nulls on exit. But isn't the 'object' still there until released ?

    Bob
     
    ECCAD, Jul 20, 2004
    #7
  8. Louis

    Louis Guest

    the release didn't help but now that i've tried the program so many times i
    noticed if i do a regen in between runs it doesn't lock up. do you know why
    that may be?
     
    Louis, Jul 20, 2004
    #8
  9. Louis

    Don Butler Guest

    Maybe someone more knowledgeable than I can shed some light.

    Don



    But isn't the 'object' still there until released ?
     
    Don Butler, Jul 20, 2004
    #9
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.