OK, the nentselp threw me for a while (matrix?!? what matrix) but I got this to work and it's exactly what I want. Thanks for the clue! BTW, this will cope a structural beam, W or HSS. The user picks are to nearest (not exact distances) so the cope location can just be "eyeballed" to where the user wants it. The layer gets set to match the picked structural element, a filleted pline creates the cope and then the user picks the lines to be trimmed.
(defun c:cop (/ OMD OSM FRAD CLAY PTC PTL PTD DISTL DISTD ANGL ANGD PTI COPLAY)
(setvar "cmdecho" 1)
(setq OMD (getvar "orthomode")) ;;gets current orthomode
(setvar "orthomode" 0) ;;sets orthomode to 0
(setq OSM (getvar "osmode")) ;;gets current osnap mode
(setvar "osmode" 32) ;;sets osnap mode to intersection
(setq FRAD (getvar "filletrad")) ;;gets current fillet radius
(setq CLAY (getvar "clayer")) ;;gets current layer
(setq PTC (getpoint "\nPick the structural shape corner <intersection>: "))
(setvar "osmode" 512) ;;sets osnap mode to nearest
(setq PTL (getpoint "\nSelect lengthwise edge <nearest>: ")
e (car (nentselp PTL)))
(setq PTD (getpoint "\nSelect depthwise edge <nearest>: "))
(setq DISTL (distance PTC PTL))
(setq DISTD (distance PTC PTD))
(setq ANGL (angle PTC PTL))
(setq ANGD (angle PTC PTD))
(setq PTI (polar PTL ANGD DISTD))
(setq COPLAY (cdr (assoc 8 (entget (car (nentselp PTL))))))
(command "-layer" "s" COPLAY "")
(command "pline" PTL "w" "0" "0" PTI PTD "")
(command "fillet" "r" "0.5")
(command "fillet" "p" "L")
(setvar "cmdecho" 1)
(command "trim" "L" "" pause)
(setvar "clayer" CLAY) ;;resets to original layer
(setvar "filletrad" FRAD) ;;resets to original fillet radius
(setvar "osmode" OSM) ;;resets to original osnap mode
(setvar "orthomode" OMD) ;;resets to original orthomode
(princ)
)