Jump to content

Dynamic Block Effective Names & "Description" --> vla-get-Comments


rayg11757

Recommended Posts

I'm looking to obtain dynamic block "Descriptions" rather than the block's "Effective Name" or "Name." The original-block's "Description" is available in the "Properties" dialog box while inside the block editor.

 

Below is a code snippet courtesy of Lee Mac's website that yields the "Effective Name," and is somewhat similar to what I'm trying to do. I assume that the new code will require the command, but I cannot figure out how to get past the anonymous block names, and to pass the value between functions.

 

(defun _GetBlockName ( obj )

(vlax-get-property obj

(if (vlax-property-available-p obj 'EffectiveName) 'EffectiveName 'Name)))

 

Thank you for any help.

Ray

Link to comment
Share on other sites

wont vla-get-Description work?

 

EDIT: Shoot. you are right. vla-get-comments

 

(defun c:test ()
      (setq blks (vla-get-Blocks (vla-get-ActiveDocument (vlax-get-acad-object))))
       (setq ent (vlax-ename->vla-object (Car (entsel))))
       (print (vla-get-comments (vla-item Blks (vla-get-effectivename ent))))
      (princ)
     )

 

silly me... :lol:

Edited by pBe
Link to comment
Share on other sites

Awesome. Thank you very much.

 

Spent about 8 hours yesterday, and I think pat of my problem was by not using the entity selection properly (Car (entsel)) and part was with not understadning the "activedocument" "acadobject" "ename" lines of code properly.

 

Someday, after all my efforts, I intend to understand AutoLISP/VLISP beyond trial-and-error.

 

Thank you, again.

Ray

Link to comment
Share on other sites

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