Jump to content

error: ActiveX Server returned the error: unknown name: Explode


Recommended Posts

Posted

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

Posted

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))

Posted
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 ?

Posted
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.

  • 3 weeks later...
Posted
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.

  • 2 years later...
Posted

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)
)

Posted

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

Posted

Usually this error occurs when a block is not dynamic.

 

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).

Posted

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

Posted
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

 

Thank you gr. Rlx! Now it works!

On another forum people say that table is a block with name like *T.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...