for instance..
(defun c:tlbind (/ ss1)
(prompt "\Joonise eksport - BIND")
(command ".undo" "begin")
(command "model")
(command "externalreferences")
(load "field2text_CMFT.lsp")
(c:cmft)
(command "-layout" "d" "abi_tingmärgid")
(command "-layer" "th" "0" "on" "0" "s" "0" "")
(if (and (setq ss1 (ssget "x" (list (cons 8 "*_abi*,*_boundary*,*_target*")))))
(command "erase" ss1 "")
)
(setq *blks*
(vla-get-Blocks
(vla-get-ActiveDocument
(vlax-get-acad-object)
)
)
)
(vlax-for item *blks*
(if (eq (vla-get-IsXref item) :vlax-true)
(progn
(setq ref (tblsearch "BLOCK" (setq xname (vla-get-Name item))))
(if (eq (logand (cdr (assoc 70 ref)) 32) 32)
(command "-xref" "_R" xname)
(command "-xref" "_D" xname)
)
)
)
)
(command "-layer" "f" "*_abi*" "")
(if (tblsearch "block" "kirjanurk_K-Projekt")
(progn (command "-bedit" "kirjanurk_K-Projekt")(load "Convert_SaveDate_Fields_CSDF")
(c:csdf)
(command "bsave")
(command "bclose")
)
)
(load "BurstUpgradedV1-2_xBURST.lsp")
(if (and (tblsearch "block" "z") (setq blks (ssget "_x" (list '(0 . "insert") (cons 2 "z,`*U*")))))
(progn
(setq i 0
xxblks (ssadd)
);; setq
(while (setq hnd (ssname blks i))
(setq blkn (vla-get-effectivename (vlax-ename->vla-object hnd)))
(if (wcmatch blkn "z")
(ssadd hnd xxblks)
);; if
(setq i (1+ i))
);; while
(if xxblks
(progn
(sssetfirst nil xxblks)
(c:xburst)
);; progn
);; if
);; progn
);; if
(setvar "BINDTYPE" 0)
(command "-xref" "_b" "*")
(command "-purge" "r" "*" "n")
(command "-purge" "a" "*" "n")
(command "-scalelistedit" "d" "*" "e")
(load "DXEdel")
(c:dxedel)
(setvar "insunits" 6)
(setvar "ltscale" 1)
(setvar "lwdisplay" 1)
(command "ucs" "w")
(command "base" "0,0,0")
(setq ss1 (ssget "x" (list (cons 8 "TL_vertikaal"))))
(command "chprop" ss1 "" "C" "bylayer" "")
(command "-purge" "a" "*" "n")
(today)
(setq OldName (vl-filename-base (getvar "dwgname"))) ;; Extracts the Drawing File Name
(setq NewFile (strcat Oldname dates)) ;; Text String for New File
(vlax-invoke
(vlax-get (vlax-get (vlax-create-object "htmlfile") 'ParentWindow) 'ClipBoardData)
'setData
"TEXT"
(strcat NewFile)
)
(setvar "wipeoutframe" 0)
(command "save" "~")
(command "undo" "end")
(command "_u")
(princ)
)
(defun c:arbind ()
(prompt "\Joonise eksport - BIND")
(command ".undo" "begin")
(command "model")
(command "externalreferences")
(load "field2text_CMFT.lsp")
(c:cmft)
(command "-layout" "d" "abi_tingmärgid")
(command "-layer" "th" "0" "on" "0" "s" "0" "")
(vl-load-com)
(setq *blks*
(vla-get-Blocks
(vla-get-ActiveDocument
(vlax-get-acad-object)
)
)
)
(vlax-for item *blks*
(if (eq (vla-get-IsXref item) :vlax-true)
(progn
(setq ref (tblsearch "BLOCK" (setq xname (vla-get-Name item))))
(if (eq (logand (cdr (assoc 70 ref)) 32) 32)
(command "-xref" "_R" xname)
(command "-xref" "_D" xname)
)
)
)
)
(setvar "BINDTYPE" 0)
(command "-xref" "_b" "*")
(if (tblsearch "block" "kirjanurk_K-Projekt")
(progn (command "-bedit" "kirjanurk_K-Projekt")(load "Convert_SaveDate_Fields_CSDF")
(c:csdf)
(command "bsave")
(command "bclose")
)
)
(load "BurstUpgradedV1-2_xBURST.lsp")
(if (setq blks (ssget "_x" (list '(0 . "insert") (cons 2 "l1,z,`*U*"))))
(progn
(setq i 0
xxblks (ssadd)
);; setq
(while (setq hnd (ssname blks i))
(setq blkn (vla-get-effectivename (vlax-ename->vla-object hnd)))
(if (wcmatch blkn "l1,z")
(ssadd hnd xxblks)
);; if
(setq i (1+ i))
);; while
(if xxblks
(progn
(sssetfirst nil xxblks)
(c:xburst)
);; progn
);; if
);; progn
);; if
(command "-purge" "r" "*" "n")
(command "-purge" "a" "*" "n")
(command "-scalelistedit" "d" "*" "e")
(load "DXEdel")
(c:dxedel)
(setvar "insunits" 6)
(setvar "ltscale" 1)
(setvar "lwdisplay" 1)
(command "ucs" "w")
(command "base" "0,0,0")
(setq ss1 (ssget "x" (list (cons 8 "TL_vertikaal"))))
(command "chprop" ss1 "" "C" "bylayer" "")
(command "-purge" "a" "*" "n")
(today)
(setq OldName (vl-filename-base (getvar "dwgname"))) ;; Extracts the Drawing File Name
(setq NewFile (strcat Oldname dates)) ;; Text String for New File
(vlax-invoke
(vlax-get (vlax-get (vlax-create-object "htmlfile") 'ParentWindow) 'ClipBoardData)
'setData
"TEXT"
(strcat NewFile)
)
(setvar "wipeoutframe" 0)
(command "save" "~")
(command "undo" "end")
(command "_u")
(princ)
)