Block Description to Multileader

Following up on the previous post – The routine illustrated below is also made by Alan Thompson found HERE lets you select a block and place a multileader containing the Block’s description (see below for “block description”)

Use the command BDESC2ML to start

Example of Block Description to Multileader:

Block Description to MLeader

 

Quick explanation of block description:

When you first create a block using the “BLOCK” command (B <enter>) you are given the option to enter a description of the block as shown below in the “Block Definition” dialog box.

If you already have a block in-place in the drawing but do not have a block description, you can add it by using the command BMOD <enter> This will launch the Block definition dialog box as if you were creating a block. You can also get to this dialog box by simply entering B <enter> at the command line.

Once the dialog box appears:

  1. Select the existing block’s name from the dropdown list.
  2. Add the desired block description under the “Description” area. Then click “ok” and update the block

Adding a Block Description

Advertisements

About AutoCAD Tips

This blog serves as a knowledge base for myself (and anyone else) so that I can reference tips & tricks that I have learned and also refer others to it as well. I hope that this blog helps you learn at least one tip to make your drafting/design experience better.
This entry was posted in AutoLISP, AutoLISP: Blocks, Blocks, Leaders, multileaders. Bookmark the permalink.

8 Responses to Block Description to Multileader

  1. solid says:

    Thank you for AutoCAD Tip

  2. DanGerAuto says:

    – Make sure the “Specify On-screen” box is Unchecked.

  3. Divas says:

    The ‘BDESC2ML’ command isn’t recognised and I am using AutoCAD 2016.
    Has this command been removed or goes by another name now?

    • AutoCAD Tips says:

      (defun c:BDESC2ML (/ #Entsel #InsPoint #Name #Desc #LandPoint)
      (vl-load-com)
      (if (setq
      #Entsel (AT:Entsel nil "\nSelect block: " '((0 . "INSERT")) nil)
      ) ;_ setq
      (progn
      ;; convert to vla-object
      (setq #Entsel (vlax-ename->vla-object (car #Entsel))
      ;; insertion point
      #InsPoint (vlax-safearray->list
      (vlax-variant-value
      (vla-get-InsertionPoint #Entsel)
      ) ;_ vlax-variant-value
      ) ;_ vlax-safearray->list
      ;; block name
      #Name (vla-get-name #Entsel)
      ;; block description
      #Desc (vla-get-comments
      (vla-item
      (vla-get-blocks
      (vla-get-activedocument (vlax-get-acad-object))
      ) ;_ vla-get-blocks
      #Name
      ) ;_ vla-item
      ) ;_ vla-get-comments
      ) ;_ setq
      (cond
      ;; no description in block
      ((eq "" #Desc)
      (princ (strcat "\nNo description for block: \""
      #Name
      "\""
      ) ;_ strcat
      ) ;_ princ
      )
      ;; specify leader landing location
      ((setq #LandPoint
      (getpoint #InsPoint
      "\nSpecify leader landing location: "
      ) ;_ getpoint
      ) ;_ setq
      (vl-cmdf "_.mleader" "_non" #InsPoint "_non" #LandPoint #Desc)
      )
      ) ;_ cond
      ) ;_ progn
      ) ;_ if

      ;;; Entsel or NEntsel with options
      ;;; #Nested - Entsel or Nentsel (T for Nentsel, nil for Entsel)
      ;;; #Message - Selection message (if nil, "\nSelect object: " is used)
      ;;; #FilterList - DXF ssget style filtering, no cons (nil if not required)
      ;;; #Keywords - Keywords to match instead of object selection (nil if not required)
      ;;; Example: (AT:Entsel nil "\nSelect MText not on 0 layer [Settings]: " '((0 . "MTEXT")(8 . "~0")) "Settings")
      ;;; Alan J. Thompson, 04.16.09
      ;;; Updated: Alan J. Thompson, 06.04.09 (changed filter coding and added layer option)
      (defun AT:Entsel (#Nested #Message #FilterList #Keywords
      / #Count #Message #Choice
      #Ent
      )
      (setvar "errno" 0)
      (setq #Count 0)
      (or #Message (setq #Message "\nSelect object: "))
      (if #Nested
      (setq #Choice nentsel)
      (setq #Choice entsel)
      ) ;_ if
      (while (and (not #Ent)
      (/= (getvar "errno") 52)
      ) ;_ and
      (and #Keywords (initget #Keywords))
      (cond
      ((setq #Ent (#Choice #Message))
      (and
      #FilterList
      (vl-consp #Ent)
      (or
      (not
      (member
      nil
      (mapcar
      '(lambda (x)
      (wcmatch
      (if
      (eq
      (type
      (cdr (assoc (car x) (entget (car #Ent))))
      ) ;_ type
      'STR
      ) ;_ eq
      (strcase
      (cdr (assoc (car x) (entget (car #Ent))))
      ) ;_ strcase
      (cdr (assoc (car x) (entget (car #Ent))))
      ) ;_ if
      (cdr x)
      ) ;_ wcmatch
      ) ;_ lambda
      #FilterList
      ) ;_ mapcar
      ) ;_ member
      ) ;_ not
      (setq #Ent nil)
      ) ;_ or
      ) ;_ and
      )
      ) ;_ cond
      (and (= (getvar "errno") 7)
      (not #Ent)
      (setq #Count (1+ #Count))
      (prompt (strcat "\nNope, keep trying! "
      (itoa #Count)
      " missed pick(s)."
      ) ;_ strcat
      ) ;_ prompt
      ) ;_ and
      ) ;_ while
      #Ent
      ) ;_ defun
      (princ)
      ) ;_ defun

  4. Divas says:

    I can’t seem to use the ‘BDESC2ML’ command on AutoCAD 2016.

    Has the command been replaced with a new name or removed?

    • AutoCAD Tips says:

      That Command name is not a regular AutoCAD command. It refers to a command that a LISP routine (shown below) uses.
      (defun c:BDESC2ML (/ #Entsel #InsPoint #Name #Desc #LandPoint)
      (vl-load-com)
      (if (setq
      #Entsel (AT:Entsel nil "\nSelect block: " '((0 . "INSERT")) nil)
      ) ;_ setq
      (progn
      ;; convert to vla-object
      (setq #Entsel (vlax-ename->vla-object (car #Entsel))
      ;; insertion point
      #InsPoint (vlax-safearray->list
      (vlax-variant-value
      (vla-get-InsertionPoint #Entsel)
      ) ;_ vlax-variant-value
      ) ;_ vlax-safearray->list
      ;; block name
      #Name (vla-get-name #Entsel)
      ;; block description
      #Desc (vla-get-comments
      (vla-item
      (vla-get-blocks
      (vla-get-activedocument (vlax-get-acad-object))
      ) ;_ vla-get-blocks
      #Name
      ) ;_ vla-item
      ) ;_ vla-get-comments
      ) ;_ setq
      (cond
      ;; no description in block
      ((eq "" #Desc)
      (princ (strcat "\nNo description for block: \""
      #Name
      "\""
      ) ;_ strcat
      ) ;_ princ
      )
      ;; specify leader landing location
      ((setq #LandPoint
      (getpoint #InsPoint
      "\nSpecify leader landing location: "
      ) ;_ getpoint
      ) ;_ setq
      (vl-cmdf "_.mleader" "_non" #InsPoint "_non" #LandPoint #Desc)
      )
      ) ;_ cond
      ) ;_ progn
      ) ;_ if

      ;;; Entsel or NEntsel with options
      ;;; #Nested - Entsel or Nentsel (T for Nentsel, nil for Entsel)
      ;;; #Message - Selection message (if nil, "\nSelect object: " is used)
      ;;; #FilterList - DXF ssget style filtering, no cons (nil if not required)
      ;;; #Keywords - Keywords to match instead of object selection (nil if not required)
      ;;; Example: (AT:Entsel nil "\nSelect MText not on 0 layer [Settings]: " '((0 . "MTEXT")(8 . "~0")) "Settings")
      ;;; Alan J. Thompson, 04.16.09
      ;;; Updated: Alan J. Thompson, 06.04.09 (changed filter coding and added layer option)
      (defun AT:Entsel (#Nested #Message #FilterList #Keywords
      / #Count #Message #Choice
      #Ent
      )
      (setvar "errno" 0)
      (setq #Count 0)
      (or #Message (setq #Message "\nSelect object: "))
      (if #Nested
      (setq #Choice nentsel)
      (setq #Choice entsel)
      ) ;_ if
      (while (and (not #Ent)
      (/= (getvar "errno") 52)
      ) ;_ and
      (and #Keywords (initget #Keywords))
      (cond
      ((setq #Ent (#Choice #Message))
      (and
      #FilterList
      (vl-consp #Ent)
      (or
      (not
      (member
      nil
      (mapcar
      '(lambda (x)
      (wcmatch
      (if
      (eq
      (type
      (cdr (assoc (car x) (entget (car #Ent))))
      ) ;_ type
      'STR
      ) ;_ eq
      (strcase
      (cdr (assoc (car x) (entget (car #Ent))))
      ) ;_ strcase
      (cdr (assoc (car x) (entget (car #Ent))))
      ) ;_ if
      (cdr x)
      ) ;_ wcmatch
      ) ;_ lambda
      #FilterList
      ) ;_ mapcar
      ) ;_ member
      ) ;_ not
      (setq #Ent nil)
      ) ;_ or
      ) ;_ and
      )
      ) ;_ cond
      (and (= (getvar "errno") 7)
      (not #Ent)
      (setq #Count (1+ #Count))
      (prompt (strcat "\nNope, keep trying! "
      (itoa #Count)
      " missed pick(s)."
      ) ;_ strcat
      ) ;_ prompt
      ) ;_ and
      ) ;_ while
      #Ent
      ) ;_ defun
      (princ)
      ) ;_ defun

  5. marina says:

    hi great post – I tried loading in the lsp and using the command “BDESC2ML” but I get this message on the command bar – “error :no function definition AT:ENSEL” any tips on how to work arroerror :no function definition und this issue?

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s