Can't get the effective name of a parametric block after changing its parameters.

aridzv
edited January 2022 in LISP
Hi.
I wrote a LSP that gets a parametric block effective name (see EF.lsp).
but when I pick a parametric block I get the anonymous blocks *U* name.
as its tured out,
as long as I don't change the plock parameters I can get the effective name,
but after changing the parameters I can only get the anonymous name.
I also attched a simple parametric block flie to use as an example.
dose any one has an idea on how to solve this issue?...
thanks,
Ari.

Comments

  • Hi Arid,
    could you try
    (setq instHandle (BmLispGet "Instance" ent))
    (setq instName (BmLispGet "InstanceName" instHandle))
  • aridzv
    edited January 2022
    Piet said:

    Hi Arid,
    could you try
    (setq instHandle (BmLispGet "Instance" ent))
    (setq instName (BmLispGet "InstanceName" instHandle))

    Hi Piet.
    I tried your suggestion with VLA object and a regular one.
    in both cases I get NIL...
    see the lisp I'm using:

    (defun c:EF11 ()
    (vl-load-com)
    (setq obj (vlax-ename->vla-object (Car (entsel))))
    ;;(print (vla-get-effectivename obj))
    (setq instHandle (BmLispGet "Instance" obj))
    (setq instName (BmLispGet "InstanceName" instHandle))
    (print instHandle)
    (print instName)

    (setq obj1 (car (entsel "\nSelect Block ")))
    (setq instHandle (BmLispGet "Instance" obj1))
    (setq instName (BmLispGet "InstanceName" instHandle))
    (print instHandle)
    (print instName)
    (princ)
    )

    Thanks,
    Ari.