You are on page 1of 16

(defun C:TIMESTAMP (/ ss1 count emax en ed blkn found thedate thetime plotby)

;define function and declare variables as local

(setvar "HIGHLIGHT" 0)
;switch off highlight

(setvar "CMDECHO" 0)
;switch off command echo

(setq ss1 (ssget "X" '((0 . "INSERT")(66 . 1))))


;filter for all blocks with attributes

(if ss1
;if any are found

(progn
;do the following

(setq count 0
;set the counter to zero

emax (sslength ss1)


;get the number of blocks

);setq

(while (< count emax)


;while the counter is less than the
;number of blocks

(setq en (ssname ss1 count)


;get the entity name

ed (entget en)
;get the entity list

blkn (dxf 2 ed)


;get the block name

);setq

(if (= "STAMP")
;if the block name is "STAMP"

(setq count emax


;stop the loop

found T
;set the flag

);setq

(setq count (1+ count))


;if not increment the counter

);end if

);while & if
(if found
;if the flag is set

(command "ERASE" en "")


;erase the block

);if

);progn

);if

(setvar "ATTDIA" 0)
;switch off dialogue boxes

(setq thedate (today))


;calculate and format date

(setq thetime (time))


;calculate and format time

(setq plotby (getvar "LOGINNAME"))


;get the users name

(command "Insert" "Stamp" "0,0" "" "" "" thedate thetime plotby)
;insert the block and fill in the attribute data

(setvar "ATTDIA" 1)
;switch the dialogues back on

(setvar "HIGHLIGHT" 1)
;switch Highlight On

(setvar "CMDECHO" 1)
;switch Cmdecho On

(princ)

);defun

;===============================================================
(defun dxf(code elist)

(cdr (assoc code elist))


;finds the association pair, strips 1st element

);defun
;===============================================================
(defun TODAY ( / d yr mo day)
(setq d (rtos (getvar "CDATE") 2 6)
yr (substr d 3 2)
mo (substr d 5 2)
day (substr d 7 2)
);setq
(strcat day "/" mo "/" yr)
);defun
;;;*-----------------------------------------------------------
(defun TIME ( / d hr m s)
(setq d (rtos (getvar "CDATE") 2 6)
hr (substr d 10 2)
m (substr d 12 2)
s (substr d 14 2)
);setq
(strcat hr ":" m ":" s)
);defun
;;;*------------------------------------------------------------
(princ)

(defun C:TIMESTAMP (/ ss1 count emax en ed blkn found thedate thetime plotby)
;define function and declare variables as local

(setvar "HIGHLIGHT" 0)
;switch off highlight

(setvar "CMDECHO" 0)
;switch off command echo

(setq ss1 (ssget "X" '((0 . "INSERT")(66 . 1))))


;filter for all blocks with attributes

(if ss1
;if any are found

(progn
;do the following

(setq count 0
;set the counter to zero

emax (sslength ss1)


;get the number of blocks

);setq

(while (< count emax)


;while the counter is less than the
;number of blocks

(setq en (ssname ss1 count)


;get the entity name

ed (entget en)
;get the entity list

blkn (dxf 2 ed)


;get the block name

);setq

(if (= "STAMP")
;if the block name is "STAMP"

(setq count emax


;stop the loop

found T
;set the flag
);setq

(setq count (1+ count))


;if not increment the counter

);end if

);while & if

(if found
;if the flag is set

(command "ERASE" en "")


;erase the block

);if

);progn

);if

(setvar "ATTDIA" 0)
;switch off dialogue boxes

(setq thedate (today))


;calculate and format date

(setq thetime (time))


;calculate and format time

(setq plotby (getvar "LOGINNAME"))


;get the users name

(command "Insert" "Stamp" "0,0" "" "" "" thedate thetime plotby)
;insert the block and fill in the attribute data

(setvar "ATTDIA" 1)
;switch the dialogues back on

(setvar "HIGHLIGHT" 1)
;switch Highlight On

(setvar "CMDECHO" 1)
;switch Cmdecho On

(princ)

);defun

;===============================================================
(defun dxf(code elist)

(cdr (assoc code elist))


;finds the association pair, strips 1st element

);defun
;===============================================================
(defun TODAY ( / d yr mo day)
(setq d (rtos (getvar "CDATE") 2 6)
yr (substr d 3 2)
mo (substr d 5 2)
day (substr d 7 2)
);setq
(strcat day "/" mo "/" yr)
);defun
;;;*-----------------------------------------------------------
(defun TIME ( / d hr m s)
(setq d (rtos (getvar "CDATE") 2 6)
hr (substr d 10 2)
m (substr d 12 2)
s (substr d 14 2)
);setq
(strcat hr ":" m ":" s)
);defun
;;;*------------------------------------------------------------
(princ)

(defun C:TIMESTAMP (/ ss1 count emax en ed blkn found thedate thetime plotby)
;define function and declare variables as local

(setvar "HIGHLIGHT" 0)
;switch off highlight

(setvar "CMDECHO" 0)
;switch off command echo

(setq ss1 (ssget "X" '((0 . "INSERT")(66 . 1))))


;filter for all blocks with attributes

(if ss1
;if any are found

(progn
;do the following

(setq count 0
;set the counter to zero

emax (sslength ss1)


;get the number of blocks

);setq

(while (< count emax)


;while the counter is less than the
;number of blocks

(setq en (ssname ss1 count)


;get the entity name

ed (entget en)
;get the entity list

blkn (dxf 2 ed)


;get the block name

);setq
(if (= "STAMP")
;if the block name is "STAMP"

(setq count emax


;stop the loop

found T
;set the flag

);setq

(setq count (1+ count))


;if not increment the counter

);end if

);while & if

(if found
;if the flag is set

(command "ERASE" en "")


;erase the block

);if

);progn

);if

(setvar "ATTDIA" 0)
;switch off dialogue boxes

(setq thedate (today))


;calculate and format date

(setq thetime (time))


;calculate and format time

(setq plotby (getvar "LOGINNAME"))


;get the users name

(command "Insert" "Stamp" "0,0" "" "" "" thedate thetime plotby)
;insert the block and fill in the attribute data

(setvar "ATTDIA" 1)
;switch the dialogues back on

(setvar "HIGHLIGHT" 1)
;switch Highlight On

(setvar "CMDECHO" 1)
;switch Cmdecho On

(princ)

);defun

;===============================================================
(defun dxf(code elist)

(cdr (assoc code elist))


;finds the association pair, strips 1st element

);defun
;===============================================================
(defun TODAY ( / d yr mo day)
(setq d (rtos (getvar "CDATE") 2 6)
yr (substr d 3 2)
mo (substr d 5 2)
day (substr d 7 2)
);setq
(strcat day "/" mo "/" yr)
);defun
;;;*-----------------------------------------------------------
(defun TIME ( / d hr m s)
(setq d (rtos (getvar "CDATE") 2 6)
hr (substr d 10 2)
m (substr d 12 2)
s (substr d 14 2)
);setq
(strcat hr ":" m ":" s)
);defun
;;;*------------------------------------------------------------
(princ)

(defun C:TIMESTAMP (/ ss1 count emax en ed blkn found thedate thetime plotby)
;define function and declare variables as local

(setvar "HIGHLIGHT" 0)
;switch off highlight

(setvar "CMDECHO" 0)
;switch off command echo

(setq ss1 (ssget "X" '((0 . "INSERT")(66 . 1))))


;filter for all blocks with attributes

(if ss1
;if any are found

(progn
;do the following

(setq count 0
;set the counter to zero

emax (sslength ss1)


;get the number of blocks

);setq

(while (< count emax)


;while the counter is less than the
;number of blocks

(setq en (ssname ss1 count)


;get the entity name
ed (entget en)
;get the entity list

blkn (dxf 2 ed)


;get the block name

);setq

(if (= "STAMP")
;if the block name is "STAMP"

(setq count emax


;stop the loop

found T
;set the flag

);setq

(setq count (1+ count))


;if not increment the counter

);end if

);while & if

(if found
;if the flag is set

(command "ERASE" en "")


;erase the block

);if

);progn

);if

(setvar "ATTDIA" 0)
;switch off dialogue boxes

(setq thedate (today))


;calculate and format date

(setq thetime (time))


;calculate and format time

(setq plotby (getvar "LOGINNAME"))


;get the users name

(command "Insert" "Stamp" "0,0" "" "" "" thedate thetime plotby)
;insert the block and fill in the attribute data

(setvar "ATTDIA" 1)
;switch the dialogues back on

(setvar "HIGHLIGHT" 1)
;switch Highlight On
(setvar "CMDECHO" 1)
;switch Cmdecho On

(princ)

);defun

;===============================================================
(defun dxf(code elist)

(cdr (assoc code elist))


;finds the association pair, strips 1st element

);defun
;===============================================================
(defun TODAY ( / d yr mo day)
(setq d (rtos (getvar "CDATE") 2 6)
yr (substr d 3 2)
mo (substr d 5 2)
day (substr d 7 2)
);setq
(strcat day "/" mo "/" yr)
);defun
;;;*-----------------------------------------------------------
(defun TIME ( / d hr m s)
(setq d (rtos (getvar "CDATE") 2 6)
hr (substr d 10 2)
m (substr d 12 2)
s (substr d 14 2)
);setq
(strcat hr ":" m ":" s)
);defun
;;;*------------------------------------------------------------
(princ)

(defun C:TIMESTAMP (/ ss1 count emax en ed blkn found thedate thetime plotby)
;define function and declare variables as local

(setvar "HIGHLIGHT" 0)
;switch off highlight

(setvar "CMDECHO" 0)
;switch off command echo

(setq ss1 (ssget "X" '((0 . "INSERT")(66 . 1))))


;filter for all blocks with attributes

(if ss1
;if any are found

(progn
;do the following

(setq count 0
;set the counter to zero

emax (sslength ss1)


;get the number of blocks
);setq

(while (< count emax)


;while the counter is less than the
;number of blocks

(setq en (ssname ss1 count)


;get the entity name

ed (entget en)
;get the entity list

blkn (dxf 2 ed)


;get the block name

);setq

(if (= "STAMP")
;if the block name is "STAMP"

(setq count emax


;stop the loop

found T
;set the flag

);setq

(setq count (1+ count))


;if not increment the counter

);end if

);while & if

(if found
;if the flag is set

(command "ERASE" en "")


;erase the block

);if

);progn

);if

(setvar "ATTDIA" 0)
;switch off dialogue boxes

(setq thedate (today))


;calculate and format date

(setq thetime (time))


;calculate and format time

(setq plotby (getvar "LOGINNAME"))


;get the users name
(command "Insert" "Stamp" "0,0" "" "" "" thedate thetime plotby)
;insert the block and fill in the attribute data

(setvar "ATTDIA" 1)
;switch the dialogues back on

(setvar "HIGHLIGHT" 1)
;switch Highlight On

(setvar "CMDECHO" 1)
;switch Cmdecho On

(princ)

);defun

;===============================================================
(defun dxf(code elist)

(cdr (assoc code elist))


;finds the association pair, strips 1st element

);defun
;===============================================================
(defun TODAY ( / d yr mo day)
(setq d (rtos (getvar "CDATE") 2 6)
yr (substr d 3 2)
mo (substr d 5 2)
day (substr d 7 2)
);setq
(strcat day "/" mo "/" yr)
);defun
;;;*-----------------------------------------------------------
(defun TIME ( / d hr m s)
(setq d (rtos (getvar "CDATE") 2 6)
hr (substr d 10 2)
m (substr d 12 2)
s (substr d 14 2)
);setq
(strcat hr ":" m ":" s)
);defun
;;;*------------------------------------------------------------
(princ)

(defun C:TIMESTAMP (/ ss1 count emax en ed blkn found thedate thetime plotby)
;define function and declare variables as local

(setvar "HIGHLIGHT" 0)
;switch off highlight

(setvar "CMDECHO" 0)
;switch off command echo

(setq ss1 (ssget "X" '((0 . "INSERT")(66 . 1))))


;filter for all blocks with attributes

(if ss1
;if any are found
(progn
;do the following

(setq count 0
;set the counter to zero

emax (sslength ss1)


;get the number of blocks

);setq

(while (< count emax)


;while the counter is less than the
;number of blocks

(setq en (ssname ss1 count)


;get the entity name

ed (entget en)
;get the entity list

blkn (dxf 2 ed)


;get the block name

);setq

(if (= "STAMP")
;if the block name is "STAMP"

(setq count emax


;stop the loop

found T
;set the flag

);setq

(setq count (1+ count))


;if not increment the counter

);end if

);while & if

(if found
;if the flag is set

(command "ERASE" en "")


;erase the block

);if

);progn

);if

(setvar "ATTDIA" 0)
;switch off dialogue boxes
(setq thedate (today))
;calculate and format date

(setq thetime (time))


;calculate and format time

(setq plotby (getvar "LOGINNAME"))


;get the users name

(command "Insert" "Stamp" "0,0" "" "" "" thedate thetime plotby)
;insert the block and fill in the attribute data

(setvar "ATTDIA" 1)
;switch the dialogues back on

(setvar "HIGHLIGHT" 1)
;switch Highlight On

(setvar "CMDECHO" 1)
;switch Cmdecho On

(princ)

);defun

;===============================================================
(defun dxf(code elist)

(cdr (assoc code elist))


;finds the association pair, strips 1st element

);defun
;===============================================================
(defun TODAY ( / d yr mo day)
(setq d (rtos (getvar "CDATE") 2 6)
yr (substr d 3 2)
mo (substr d 5 2)
day (substr d 7 2)
);setq
(strcat day "/" mo "/" yr)
);defun
;;;*-----------------------------------------------------------
(defun TIME ( / d hr m s)
(setq d (rtos (getvar "CDATE") 2 6)
hr (substr d 10 2)
m (substr d 12 2)
s (substr d 14 2)
);setq
(strcat hr ":" m ":" s)
);defun
;;;*------------------------------------------------------------
(princ)

(defun C:TIMESTAMP (/ ss1 count emax en ed blkn found thedate thetime plotby)
;define function and declare variables as local

(setvar "HIGHLIGHT" 0)
;switch off highlight
(setvar "CMDECHO" 0)
;switch off command echo

(setq ss1 (ssget "X" '((0 . "INSERT")(66 . 1))))


;filter for all blocks with attributes

(if ss1
;if any are found

(progn
;do the following

(setq count 0
;set the counter to zero

emax (sslength ss1)


;get the number of blocks

);setq

(while (< count emax)


;while the counter is less than the
;number of blocks

(setq en (ssname ss1 count)


;get the entity name

ed (entget en)
;get the entity list

blkn (dxf 2 ed)


;get the block name

);setq

(if (= "STAMP")
;if the block name is "STAMP"

(setq count emax


;stop the loop

found T
;set the flag

);setq

(setq count (1+ count))


;if not increment the counter

);end if

);while & if

(if found
;if the flag is set

(command "ERASE" en "")


;erase the block
);if

);progn

);if

(setvar "ATTDIA" 0)
;switch off dialogue boxes

(setq thedate (today))


;calculate and format date

(setq thetime (time))


;calculate and format time

(setq plotby (getvar "LOGINNAME"))


;get the users name

(command "Insert" "Stamp" "0,0" "" "" "" thedate thetime plotby)
;insert the block and fill in the attribute data

(setvar "ATTDIA" 1)
;switch the dialogues back on

(setvar "HIGHLIGHT" 1)
;switch Highlight On

(setvar "CMDECHO" 1)
;switch Cmdecho On

(princ)

);defun

;===============================================================
(defun dxf(code elist)

(cdr (assoc code elist))


;finds the association pair, strips 1st element

);defun
;===============================================================
(defun TODAY ( / d yr mo day)
(setq d (rtos (getvar "CDATE") 2 6)
yr (substr d 3 2)
mo (substr d 5 2)
day (substr d 7 2)
);setq
(strcat day "/" mo "/" yr)
);defun
;;;*-----------------------------------------------------------
(defun TIME ( / d hr m s)
(setq d (rtos (getvar "CDATE") 2 6)
hr (substr d 10 2)
m (substr d 12 2)
s (substr d 14 2)
);setq
(strcat hr ":" m ":" s)
);defun
;;;*------------------------------------------------------------
(princ)

You might also like