Jump to content

Recommended Posts

Posted

Hello

To get Block Name of selected block entity I use:

(setq Name (cdr (assoc 2 Ent)) )

It works fine but not with dynamic blocks. If I try to get name of dynamic block with it I get some strange names like *U126, *U123.

 

How to get the real definition name of these blocks?

Posted

"*U" Block names are valid. They indicate the the BLOCK is anonymous. You can look up the BLOCK table definitions just as you can any other block ( tblsearch "BLOCK" *U123")

 

What you can not assume is that the name will be the same every time that you open the drawing. The names change based on many others things. -David

Posted

And if I know the *U name, how can I get the Name of this block definition?

 

Like if I define dynamic block "DOORS". Then create entity of this doors that gets name "*U123", how do I know that "*U123" derives from "DOORS"?

Posted

please try:

 

(defun c:dynname (/ ed)
(prompt "\n....Select a Block...:")
 (and
  (assoc 360
   (setq ed
    (entget
     (ssname
      (ssget "_:E:S" '((0 . "INSERT")))0)))) ;_ {setq
       (repeat 3
        (setq ed
         (entget (cdr (assoc 360 ed)))
           ) ;_ {setq
       ) ;_ {repeat
       (setq ed (entget (cdr (assoc 340 ed))))
   ) ;_ {and
   (setq ed (cdr (assoc 2 ed)))
) ;_ {defun

Posted

Yes it works great!!! Thanks.

Posted
Wizman, you are a genius :P

 

lee, thanks but im still studying....'-)

Posted

Or

 

 (vla-get-EffectiveName
   (vlax-ename->vla-object
     (car(entsel "\nSelect block: "))))

 

Do not foget (vl-load-com).

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