error: ActiveX Server returned
error: ActiveX Server returned the error: unknown name: Explode , Why ?autocad 2010 , windows xp
;|==================================================-===========================* Универсальная функция разбития proxy-объектов.* Параметры вызова:*нет* Примеры вызова:(_kpblc-block-explode-proxy)==================================================-===========================|;(defun _kpblc-block-explode-proxy (/ selset item layer_list) (vl-load-com) (setq selset (ssget "_X" '((0 . "ACAD_PROXY_ENTITY")))) (vlax-for item (vla-get-layers (vla-get-activedocument (vlax-get-acad-object))) (if (= (vla-get-lock item) :vlax-true) (progn (setq layer_list (append layer_list '(item))) (vla-put-lock item :vlax-false) ) ;_ end of progn ) ;_ end of if ) ;_ end of vlax-for (while (and selset (> (sslength selset) 0) ) ;_ end of and (setq item (ssname selset 0)) (ssdel item selset) (vla-explode (vlax-ename->vla-object item)) ) ;_ end of while (foreach item layer_list (vla-put-lock item :vlax-true) ) ;_ end of foreach ) ;_ end of defun;|==================================================-===========================* Сервисная функция для вызова из ком.строки==================================================-===========================|;(defun c:xproxy (/ adoc) (vla-startundomark (vla-get-activedocument (vlax-get-acad-object))) (_kpblc-block-explode-proxy) (vla-endundomark (vla-get-activedocument (vlax-get-acad-object))) ) ;_ end of defun Change:
(vla-explode (vlax-ename->vla-object item))
to:
(if (vlax-method-applicable-p (setq obj (vlax-ename->vla-object item)) 'explode) (vla-explode obj))
Thanks Lee,Now, No err.
why I use this routine can't explode "ACAD_PROXY_ENTITY" object ?
As far as I'm aware the ActiveX explode method does not apply to an ACAD_PROXY_ENTITY entity type; you may need to call the standard EXPLODE command to process this object.
Many thanks ,Lee. You're welcome Hi!
I have a similar error. "error: ActiveX Server returned the error: unknown name: EffectiveName"
And I have this error if file has a table. If I delete a table everithing is good.
autocad 2015 , windows 8
;; Returns list of the Anonymous names taken by a Dynamic Block (if any)-Lee Mac 2011-www.lee-mac.com;; Arguments:block- name of Dynamic Block.(defun AnonymousInstancesof ( block / def rec nme ref lst ) (while (setq def (tblnext "BLOCK" (null def))) (if (= 1 (logand 1 (cdr (assoc 70 def)))) (progn (setq rec (entget (cdr (assoc 330 (entget (tblobjname "BLOCK" (setq nme (cdr (assoc 2 def)))) ) ) ) ) ) (while (setq ref (assoc 331 rec)) (if (and (eq block (vla-get-effectivename (vlax-ename->vla-object (cdr ref)))) (not (member nme lst)) ) (setq lst (cons nme lst)) ) (setq rec (cdr (member (assoc 331 rec) rec))) ) ) ) ) (reverse lst)) Welcome on CadTutor Doctor_Che
Usually this error occurs when a block is not dynamic. Use this :
(setq object (vlax-ename->vla-object (cdr ref)))(if (vlax-property-available-p object 'effectivename)(setq block (vla-get-effectivename object))(setq block (vla-get-name object)))
gr. Rlx
But if I understand good the problem is not with block...
I have tried this code with new clean file.
(print (AnonymousInstancesof "blockname"))
The result is "nil".
After I have inserted a table (just new empty table) into the file the result is "error: ActiveX Server returned the error: unknown name: EffectiveName".
So it is no block or dynamic block in file. Just a table (ACAD_TABLE). I'm not much of an expert on tables but assuming it is this (and not any other) function that's responsible for the error you can try :
(and (vlax-property-available-p (vlax-ename->vla-object (cdr ref)) 'effectivename) (eq block (vla-get-effectivename (vlax-ename->vla-object (cdr ref)))) (not (member nme lst)))
but I have no clue on this moment why this function would filter out a table in the first place.
gr. Rlx
页:
[1]
2