+ Reply to Thread
Results 1 to 3 of 3
  1. #1
    Super Member
    Computer Details
    woodman78's Computer Details
    Operating System:
    Win XP
    Computer:
    Dell GX280
    Discipline
    Transport
    woodman78's Discipline Details
    Occupation
    Road Design Engineer
    Discipline
    Transport
    Details
    I work in a local authority design office with a staff of 13. We carry out road schemes ranging from overlays up to 2 km long new schemes.
    Using
    Civil 3D 2011
    Join Date
    Jul 2009
    Location
    Ireland
    Posts
    675

    Default Leader update text

    Registered forum members do not see this ad.

    I have this lisp that I modified from on that LeeMac wrote for me to update the text on dimensions. I was looking to make it work for leaders but I haven't got it working.

    Can an option be added to set the width of the multiline text for the leader as well?

    Code:
    leader_update : dialog { key = "dctitle";
      spacer;  
      : list_box { label = "Notes:"; key = "lst";
                   alignment = centered; fixed_height = true;
                   fixed_width = true; width = 50; height = 20; }
      spacer;
      ok_cancel;
    }


    Code:
    (defun c:leader_update ( / *error* _read )
      ;; © Lee Mac 2010
      
    
      (setq dcfilename  "leader_update.dcl"   ;; DCL Filename
    
            Strfilename "CCC_NNRDO_leader_update.txt"   ;; Data Filename
       )
    
    
      (defun *error* ( msg )
        (and dcTag (unload_dialog dcTag))
        (or (wcmatch (strcase msg) "*BREAK,*CANCEL*,*EXIT*")
            (princ (strcat "\n** Error: " msg " **")))
        (princ))
    
    
      (defun _read ( file / ofile lst nl )
    
        (cond (  (setq ofile (open file "r"))
             
                 (while (setq nl (read-line ofile))
                   (setq lst (cons nl lst)))
    
                 (close ofile)))
      
        (reverse lst)
      )
    
    
      (cond (  (not (setq Strfilename (findfile Strfilename)))
    
               (princ "\n** Data File not Found **"))
    
            (  (not (setq StrLst (_read Strfilename)))
    
               (princ "\n** Data File Empty **"))
    
            (  (not (setq ss (ssget "_:L" '((0 . "*LEADER"))))))
    
            (  (<= (setq dcTag (load_dialog dcfilename)) 0)
    
               (princ "\n** Dialog Definition Not Found **"))
    
            (  (not (new_dialog "leader_update" dcTag))
    
               (princ "\n** Dialog Could not be Loaded **"))
    
            (t
               (start_list "lst")
               (mapcar (function add_list) StrLst)
               (end_list)
    
               (set_tile "dcltitle" "Dimension Notes")
    
               (setq ptr (set_tile "lst" "0"))
             
               (action_tile  "lst" "(setq ptr $value)")
    
               (setq dcFlag (start_dialog) dcTag (unload_dialog dcTag) Str (nth (atoi ptr) StrLst))
    
               (if (= 1 dcFlag)
                 (
                   (lambda ( i )
                     (while (setq ent (ssname ss (setq i (1+ i))))
                       (entupd                     
                         (cdr
                           (assoc -1
                             (entmod
                               (subst (cons 1 (strcat str)) (assoc 1 (entget ent)) (entget ent))
                             )
                           )
                         )
                       )
                     )
                   )
                   -1
                 )
    
                 (princ "\n*Cancel*")
               )
             )
      )
      
      (princ)
    )
    Thanks.
    Attached Files

  2. #2
    Super Member
    Computer Details
    woodman78's Computer Details
    Operating System:
    Win XP
    Computer:
    Dell GX280
    Discipline
    Transport
    woodman78's Discipline Details
    Occupation
    Road Design Engineer
    Discipline
    Transport
    Details
    I work in a local authority design office with a staff of 13. We carry out road schemes ranging from overlays up to 2 km long new schemes.
    Using
    Civil 3D 2011
    Join Date
    Jul 2009
    Location
    Ireland
    Posts
    675

    Default

    I found this lisp below at the following location:
    http://lispcad.com/2012/03/add-leade...e-multileader/

    Can this be modified to create an mleader based on a style when a text string is selected from the dcl window?

    Code:
    (defun c:mt2ml ( / oobj nobj nstrg)
      (vl-load-com)
      (setq oobj (vlax-ename->vla-object (car (nentsel "nSelect source text: "))))
      (if (= (vlax-get-property oobj 'ObjectName) "AcDbMText")
        (setq nstrg (vlax-get-property oobj 'TextString))
        (exit)
        )
      (command "_MLEADER")
      (while (= 1 (logand (getvar "CMDACTIVE") 1)) (command PAUSE))
      (setq nobj (vlax-ename->vla-object (entlast)))
      (if (= (vlax-get-property nobj 'ObjectName) "AcDbMLeader")
        (vlax-put-property nobj 'TextString nstrg)
        (exit)
        )
      (entdel (vlax-vla-object->ename oobj))
      (princ)
    )

  3. #3
    Super Member
    Computer Details
    woodman78's Computer Details
    Operating System:
    Win XP
    Computer:
    Dell GX280
    Discipline
    Transport
    woodman78's Discipline Details
    Occupation
    Road Design Engineer
    Discipline
    Transport
    Details
    I work in a local authority design office with a staff of 13. We carry out road schemes ranging from overlays up to 2 km long new schemes.
    Using
    Civil 3D 2011
    Join Date
    Jul 2009
    Location
    Ireland
    Posts
    675

    Default

    Registered forum members do not see this ad.

    I have taken a different approach to this now. I have created blocks with leaders and the specific text I want but how do I get this lisp that LeeMac helped me with to explode the blocks on input? I have researched that I need to put star before the name but how do I do this when I can select multiple blocks?

    Code:
    insert_lining_leaders : dialog {                                   //*dialog name
             label = "Lining Leaders";           //*give it a label
    : row {                                    //*define row
                  : paragraph {                          //*define paragraph
                 }                                      //*end paragraph
             }                                          //*end row
             : row {                                    //*define row
               : boxed_column {                         //*define boxex_column
                 label = "Choose a Note:";               //*give it a label 
                 : list_box {                         //*define popup_list
                   key = "S1";                          //*give it a name
                   width=100;                        //*edit_width
                   fixed_width=true;               //*fixed width
    	 height=20;		//*Height
    	 fixed_height=true;		//*fixed height
                   alignment = right;                   //*alignment
    	 multiple_select=true;
                 }                                      //*end popup_list
                 : spacer {                             //*define spacer
                   height = 0;                          //*height
                 }                                      //*end spacer
               }                                        //*end boxed_column
             }                                          //*end row
             : row {                                    //*define row
               : column {                               //*define column
                 ok_cancel ;                            //*predifined OK/Cancel
                 : paragraph {                          //*define paragraph
                    : text_part {                        //*define more text
                     label = "CCC NNRDO     v1.0.24.07.2009";           //*some more text
                   }                                    //*end text
                 }                                      //*end paragraph
               }                                        //*end column
             }                                          //*end row
           }                                            //*end dialog



    Code:
    (defun c:insert_lining_leaders (/ *error* DCHANDLE INPT OV PT RTN S1_LIST VL SUSM)
    
      (setq SUSM (getvar "osmode"))
    
      (defun *error* (msg)
        (and dcHandle (unload_dialog dcHandle))
        (and ov (mapcar 'setvar vl ov))
        (or (wcmatch (strcase msg) "*BREAK,*CANCEL*,*EXIT*")
            (princ (strcat "\n** Error: " msg " **")))
        (princ))
    
      (setq S1_list
       '("*** Smybols ***" 											;0
         "M115 Yield Triangle" 											;1
    
        )
      )
    
      (setq vl '("CMDECHO" "CLAYER" "OSMODE") ov (mapcar 'getvar vl))
      (setvar "attdia" 1)
      (cond (  (<= (setq dcHandle (load_dialog "insert_lining_leaders.dcl")) 0)
    
               (princ "\n** Dialog file not Found **"))
    
            (  (not (new_dialog "insert_lining_leaders" dcHandle))
    
               (princ "\n** Dialog Definition Not Found **"))
    
            (t
    
               (start_list "S1")
               (mapcar (function add_list) S1_list)
               (end_list)
    
               (set_tile "S1" (setq *def* (cond (*def*) ("1"))))
    
               (action_tile "S1"     "(setq *def* $value)")
             
               (action_tile "accept" "(cond ((member (atoi *def*) '(0)) (alert \"Invalid Note\"))
                                            ((done_dialog 1)))")
             
               (action_tile "cancel" "(done_dialog 0)")
    
               (setq rtn (start_dialog))
    
               (setq dcHandle (unload_dialog dcHandle))
    
               (if (= 1 rtn)
                 (progn
    
                   (or (tblsearch "LAYER" "CCC_SHEET_LAYOUT_Notes")
                       (entmake (list (cons 0 "LAYER")
                                      (cons 100 "AcDbSymbolTableRecord")
                                      (cons 100 "AcDbLayerTableRecord")
                                      (cons 2 "CCC_SHEET_LAYOUT_Notes")
                                      (cons 70 0)
                                      (cons 62 7)
                                      (cons 370 30))))
    
                   (mapcar 'setvar vl '(0 "CCC_SHEET_LAYOUT_Notes" 0))
    
                   (foreach block (mapcar
                                    (function
                                      (lambda (x) (nth x S1_list)))
    
                                    (read (strcat "(" *def* ")")))
                     (setvar "osmode" 1)
                     (if (setq pt (setq INPT (getpoint "\nPick Insertion Point: ")))
    
                       (command "_.-insert" block INPT "1" "1" "0"))))
    		 	
    
    
                 (princ "\n*Cancel*"))))
    	(setvar "osmode" SUSM)
    	(setvar "attdia" 0)
      (mapcar 'setvar vl ov)
    
    (princ))

Similar Threads

  1. Replies: 0
    Last Post: 5th Apr 2012, 08:15 pm
  2. Leader Text.....
    By StykFacE in forum AutoCAD Drawing Management & Output
    Replies: 7
    Last Post: 30th Jan 2012, 04:07 pm
  3. Leader/text to multileader
    By pmcwilliams in forum AutoCAD General
    Replies: 7
    Last Post: 10th Jan 2012, 03:23 pm
  4. Leader text
    By cmjay83 in forum Autodesk Inventor
    Replies: 5
    Last Post: 25th Aug 2009, 12:40 pm
  5. Leader for Point text
    By Mark D Laing in forum AutoCAD Beginners' Area
    Replies: 1
    Last Post: 19th Jun 2006, 02:48 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