Author Topic: Xref Attacher Identifier  (Read 1778 times)

0 Members and 1 Guest are viewing this topic.

whdjr

  • Guest
Xref Attacher Identifier
« on: November 15, 2005, 09:43:26 AM »
Does anyone have any partial code or ideas of how this could be done in a small office with less than 10 users?

I would like a way that if I open a file that has an xref in it I can click on the xref an it will tell me what user attached that xref.  Would this be some xdata that is tagged onto the xref that collects the username variable at the time they attached the xref?

All ideas and suggestions would be helpful.

ronjonp

  • Needs a day job
  • Posts: 7527
Re: Xref Attacher Identifier
« Reply #1 on: November 15, 2005, 10:55:20 AM »
maybe incorporate this into a reactor:

Code: [Select]
(defun c:putx (/ keyw uname DWGNAME SS E count XD)
  (defun timedate (/ cdate ctime ampm stime)
    (setq cdate (rtos (fix (getvar 'cdate)) 2 0)
  ctime (rtos (rem (getvar 'cdate) 1) 2 6)
  ampm (if (<= (atof (substr ctime 3 2)) 12)
  "AM"
  "PM"
)
  stime (strcat
  (substr cdate 5 2)
  "-"
  (substr cdate 7 2)
  "-"
  (substr cdate 1 4)
  " @ "
  (substr ctime 3 2)
  ":"
  (substr ctime 5 2)
  ":"
  ampm
)
    )
  )
  (setvar "cmdecho" 0)
  (initget 1 "Select All")
  (setq Keyw (getkword "\nEnter selection option (Select / All): "))
  (cond
    ((= Keyw "Select") (setq SS (ssget)))
    ((= Keyw "All") (setq SS (ssget "X")))
  )
  (if (not (tblsearch "APPID" "XREF_INFO"))
    (regapp "XREF_INFO")
  )
  (setq uname (getenv "username"))
  (setq Count 0)
  (repeat (sslength SS)
    (setq e (entget (ssname SS Count)))
    (if (not (assoc -3 e))
      (progn
(setq xd (list (list -3
     (list "XREF_INFO"
   (cons 1000
(strcat "Attached by "
uname
" on "
(timedate)
)
   )
     )
       )
)
)
(setq e (append e xd))
(entmod e)
(setq Count (+ Count 1))
      )
    )
  )
  (princ)
)

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC