[font=Times New Roman][font=Times New Roman](defun c:1x ( / ss bnum ent bname a b );_need to locolize variables[/font]
[font=Times New Roman]; (command "undo" "end" "undo" "begin");_this is wrong it shound be[/font]
[font=Times New Roman] (command "undo""begin");_this marks the beginning of a group to be undon if the undo command is involked[/font]
[font=Times New Roman](setvar "luprec" 0);_sets # of zeros after desimal point (this is not needed)[/font]
[font=Times New Roman];_prompts user to select a block[/font]
[font=Times New Roman](setq ss (ssget[/font]
[font=Times New Roman](list[/font]
[font=Times New Roman]'(0 . "INSERT")[/font]
[font=Times New Roman])))[/font]
[font=Times New Roman](setq bnum (sslength ss));_# of selected blocks in drawing[/font]
[font=Times New Roman](setq ent (ssname ss 0));_gets first item in the selection set[/font]
[font=Times New Roman](setq name (entget ent));_# gets block entity info[/font]
[font=Times New Roman](setq bname (cdr (assoc 2 name)));_gets block name[/font]
[font=Times New Roman](setvar "orthomode" 0);_turns ortho mode off[/font]
[font=Times New Roman](setq a (rtos bnum ));_# of selected blocks in the drawing[/font]
[font=Times New Roman](setq b (strcat bname "(" a ")"));_puts the block name and the # of occurences of that block together[/font]
[font=Times New Roman](command "leader" pause pause "" b "") ;_makse the leader with block anme and number of occurenced of that block in the drawing[/font]
[font=Times New Roman](setvar "orthomode" 0);_turns ortho mode off[/font]
[font=Times New Roman](setvar "luprec" 2);_sets # of zeros after desimal point (this is not needed)[/font]
[font=Times New Roman] (command "undo" "end");_this marks the end of a group to be undon if the undo command is involked[/font]