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.
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 )
(defun crac (/ 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 crac2 () (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
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
I think the 'ins', being local is just a 'symbol' - which nulls on exit. But isn't the 'object' still there until released ? Bob
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?
Maybe someone more knowledgeable than I can shed some light. Don But isn't the 'object' still there until released ?