+ Reply to Thread
Page 2 of 3 FirstFirst 1 2 3 LastLast
Results 11 to 20 of 22
  1. #11
    Luminous Being alanjt's Avatar
    Using
    Civil 3D 2013
    Join Date
    Apr 2008
    Posts
    6,199

    Default

    Registered forum members do not see this ad.

    Quote Originally Posted by seapea View Post
    I'm impressed with your quick reply. thanks

    ok, i run rhe lsp, select the block, see "abc", click to 'Specify opposite corner:', and it all goes away! What am I missing? Does this code go into the other lisp file test.lsp? confused
    Completely separate from the other routine and it should work fine - does on my end...

    BnameLabel.gif
    DropBox
    Seann: ...it went crazy ex-girlfriend on me...
    eric_monceaux...its pretty funny seeing two AutoCAD Gods give each other flak...

  2. #12
    Forum Newbie
    Using
    AutoCAD 2013
    Join Date
    Jun 2013
    Posts
    2

    Default

    Hello,

    does anybody know, how to update this lisp code in a way, that the leader would not start at the block insertion point? I tried to delete some lines from the code, but ended up in AC crash

    thanks for help

  3. #13
    Luminous Being alanjt's Avatar
    Using
    Civil 3D 2013
    Join Date
    Apr 2008
    Posts
    6,199

    Default

    Quote Originally Posted by janickovic View Post
    Hello,

    does anybody know, how to update this lisp code in a way, that the leader would not start at the block insertion point? I tried to delete some lines from the code, but ended up in AC crash

    thanks for help


    Code:
    (defun c:BNameLabel (/ ent entl obj)
      (cond ((not (setq ent (car (entsel "\nSelect block: ")))))
            ((not (eq (cdr (assoc 0 (entget ent))) "INSERT")) (princ "\nInvalid object!"))
            ((setq pt (getpoint "\nSpecify first point: "))
             (setq entl (entlast))
             (vl-cmdf "_.mleader" "_non" pt "\\")
             (while (eq (logand 1 (getvar 'CMDACTIVE)) 1) (vl-cmdf ""))
             (if (not (equal entl (setq entl (entlast))))
               (vla-put-textstring
                 (vlax-ename->vla-object entl)
                 (vlax-get-property
                   (setq obj (vlax-ename->vla-object ent))
                   (if (vlax-property-available-p obj 'EffectiveName)
                     'EffectiveName
                     'Name
                   )
                 )
               )
             )
            )
      )
      (princ)
    )
    (vl-load-com)
    (princ)
    DropBox
    Seann: ...it went crazy ex-girlfriend on me...
    eric_monceaux...its pretty funny seeing two AutoCAD Gods give each other flak...

  4. #14
    Forum Newbie
    Using
    AutoCAD 2013
    Join Date
    Jun 2013
    Posts
    2

    Default

    Hi,

    thanks, I figured it out in the mean time, nevermind. In addition, I updated the code, so now the leader can read attribute from a block and attach it to the name of the block. But I am getting some weird error about parameters and I would like to have ability to show more parameters, but I don't know the way how to do it (I learned list 10 years ago, in school, but my memory are not the good, I was only able to do this).

    Code:
    (defun c:TEST (/ #Entsel #InsPoint #Name #Desc #LandPoint)
    
     
      (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
    
     
            )
    
     
     
    
     
      (and 
    
     
     
    
     
       (foreach att (vlax-invoke #Entsel 'GetAttributes)
    
     
         (eq "TAG" (vla-get-textstring att)
    
     
          (vl-cmdf "_.mleader" "_non" PAUSE "_non" PAUSE (strcat #Name (chr 10) 
    (vla-get-textstring att)))
    
     
         )
    
     
       )
    
     
     
    
     
    ;   (vl-cmdf "_.mleader" "_non" PAUSE "_non" PAUSE #Name)
    
     
      )
    
     
          ) ;_ cond
    
     
        ) ;_ progn
    
     
      ) ;_ if
    
     
      (princ)
    
     
    ) ;_ defun
    Last edited by janickovic; 12th Jun 2013 at 01:28 pm.

  5. #15
    Super Moderator SLW210's Avatar
    Computer Details
    SLW210's Computer Details
    Operating System:
    Windows 7 PRO 64-bit
    Computer:
    IBM Lenovo
    Motherboard:
    ACPI x64
    CPU:
    Pentium(R) i5 4570 @ 3.2GHz
    RAM:
    8 GB RAM
    Graphics:
    Nvidia Quadro 600 1GB
    Primary Storage:
    300 GB
    Secondary Storage:
    650GB
    Monitor:
    2x ThinkVision 24"
    Discipline
    Multi-disciplinary
    SLW210's Discipline Details
    Occupation
    Design Draftsman
    Discipline
    Multi-disciplinary
    Details
    Mostly do drafting related to manufacturing. From doing site layouts with proposed updates, additions and renovations to be budgeted and submitted for bid, to updating and changing existing drawings to reflect maintenance and repair/revision work done on site.
    Using
    AutoCAD 2018
    Join Date
    May 2007
    Location
    South Florida, USA
    Posts
    11,883

    Default

    Please read the Code posting guidelines and use Code Tags for your Code.
    “A narrow mind and a fat head invariably come on the same person” Zig Zigler



  6. #16
    Forum Newbie
    Using
    Mechanical 2014
    Join Date
    Aug 2015
    Posts
    1

    Default Multileader to Block

    Is there a way to do the opposite of this lisp? That is, create and then name a block based on its multileader callout)? [the block name would also be followed by a postscript]. I have about a thousand of these to do, each w/ a different name.

  7. #17
    Forum Newbie
    Using
    AutoCAD 2016
    Join Date
    May 2016
    Posts
    4

    Default

    I tried, but is giving fatal error

  8. #18
    Forum Newbie
    Discipline
    Manufacture
    Using
    AutoCAD 2017
    Join Date
    Nov 2017
    Posts
    2

    Default Were you able to figure this out?

    Quote Originally Posted by seapea View Post
    I'm impressed with your quick reply. thanks

    ok, i run rhe lsp, select the block, see "abc", click to 'Specify opposite corner:', and it all goes away! What am I missing? Does this code go into the other lisp file test.lsp? confused
    Were you able to figure this out?

  9. #19
    Forum Newbie
    Discipline
    Manufacture
    Using
    AutoCAD 2017
    Join Date
    Nov 2017
    Posts
    2

    Default OHHH... Nevermind.

    Quote Originally Posted by MPEREZ View Post
    Were you able to figure this out?
    I see that I was not using the correct command.

  10. #20
    Forum Newbie
    Discipline
    Mechanical
    Using
    AutoCAD 2008
    Join Date
    Dec 2017
    Posts
    3

    Default

    Registered forum members do not see this ad.

    Hello

    I'm using the code from post #13 and I would like to modify it a bit.
    All the blocks in my the drawing have an attribute named "TAG" and I would like to show that value instead of the block name.

    Can anyone help me please. Thanks.

Similar Threads

  1. Leader/text to multileader
    By pmcwilliams in forum AutoCAD General
    Replies: 11
    Last Post: 30th Aug 2017, 04:26 pm
  2. Multileader with block content
    By dinarele in forum AutoCAD 2D Drafting, Object Properties & Interface
    Replies: 2
    Last Post: 18th Aug 2009, 03:07 pm
  3. Multileader text
    By alijahed in forum AutoCAD General
    Replies: 5
    Last Post: 2nd Mar 2009, 09:58 am
  4. Cannot Edit Multileader Text
    By rustysilo in forum AutoCAD General
    Replies: 7
    Last Post: 2nd Feb 2009, 04:38 pm
  5. Multileader text at arrowhead end?
    By bbohannon1 in forum AutoCAD General
    Replies: 0
    Last Post: 13th Oct 2008, 07:11 pm

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts