error: ActiveX Server returned an error: Element
not found....
Not sure what is going on, this routine ran before lunch.
Code:
(vl-load-com)
(defun c:mark (/ *error* acsp adoc axss nblk_obj prop_list ss)
(lisplog)
(command "_.insert" "c:/usr/local/blckmark" "0,0" blscale blscale "0")
(defun *error* (msg)
(if
(vl-position msg '("Function cancelled" "quit / exit abort"))
(princ)
(princ msg))
(vla-endundomark
(vla-get-activedocument
(vlax-get-acad-object)))
(princ)
)
(setq adoc (vla-get-activedocument (vlax-get-acad-object)))
(setq acsp (vla-get-modelspace adoc))
(vla-endundomark adoc)
(vla-startundomark adoc)
;;;(vla-zoomall (vla-get-application adoc))
(if (setq ss (ssget "_X" (list (cons 0 "INSERT")(cons 2 "ge_blk*"))));;select block with prefix "ge_block..."
(progn
(setq newname "blckmark")
(setq axss (vla-get-activeselectionset adoc))
(vlax-for a axss
(setq prop_list
(list
(vla-get-insertionpoint a)
(vla-get-xscalefactor a)
(vla-get-yscalefactor a)
(vla-get-zscalefactor a)
(vla-get-rotation a)
(vla-get-layer a)))
(setq nblk_obj
(vla-insertblock acsp (nth 0 prop_list) newname
(nth 1 prop_list)
(nth 2 prop_list)
(nth 3 prop_list)
(nth 4 prop_list)))
(vla-erase a)
(vlax-release-object a))
(vla-put-layer nblk_obj (nth 5 prop_list))
(vla-clear axss)
(vla-delete axss)
(vlax-release-object axss)
(*error* nil)
)
)
(princ)
)
(prompt "\n\t\t\t >> Type MARK to execute >> \n")
(princ)
the error happens when I get to
Code:
(vla-get-insertionpoint a)