Yes MAPTRIM failed in loop, i don't know why!
But in your case, you can try this, seem to work.
Code:
(defun c:1b1tr ( / js dxf_cod lremov mod_sel n ent pt rad pt1 pt2 js_trim ent_l dxf_ent dxf_10 dxf_11)
(princ "\nSelect model object for cutting edges.")
(while
(null
(setq js
(ssget "_+.:E:S"
(list
'(0 . "CIRCLE")
(cons 67 (if (eq (getvar "CVPORT") 1) 1 0))
(cons 410 (if (eq (getvar "CVPORT") 1) (getvar "CTAB") "Model"))
)
)
)
)
(princ "\nIsn't an available object!")
)
(setq dxf_cod (entget (ssname js 0)))
(foreach m (foreach n dxf_cod (if (not (member (car n) '(0 67 410 8 6 62 48 420 70))) (setq lremov (cons (car n) lremov))))
(setq dxf_cod (vl-remove (assoc m dxf_cod) dxf_cod))
)
(initget "Single All Manual")
(if (eq (setq mod_sel (getkword "\nSelect mode, [Single/All/Manual]<Manual>: ")) "Single")
(setq n -1)
(if (eq mod_sel "All")
(setq js (ssget "_X" dxf_cod) n -1)
(setq js (ssget dxf_cod) n -1)
)
)
(cond
(js
(if (eq mod_sel "All") (command "_.zoom" "_extent"))
(repeat (setq n (sslength js))
(setq
ent (ssname js (setq n (1- n)))
dxf_cod (entget ent)
pt (cdr (assoc 10 dxf_cod))
rad (cdr (assoc 40 dxf_cod))
pt1 (mapcar '- pt (list rad rad 0.0))
pt2 (mapcar '+ pt (list rad rad 0.0))
)
(cond
((and ent pt1 pt2)
(setq js_trim
(ssget "_C" pt1 pt2
(list
'(0 . "LINE")
(cons 67 (if (eq (getvar "CVPORT") 1) 1 0))
(cons 410 (if (eq (getvar "CVPORT") 1) (getvar "CTAB") "Model"))
)
)
)
(ssdel ent js_trim)
(cond
((and js_trim (not (zerop (sslength js_trim))))
(repeat (setq nb (sslength js_trim))
(setq
ent_l (ssname js_trim (setq nb (1- nb)))
dxf_ent (entget ent_l)
dxf_10 (cdr (assoc 10 dxf_ent))
dxf_11 (cdr (assoc 11 dxf_ent))
)
(cond
((equal dxf_10 pt 1E-8)
(entmod (subst (cons 10 (polar dxf_10 (angle dxf_10 dxf_11) rad)) (assoc 10 dxf_ent) dxf_ent))
)
((equal dxf_11 pt 1E-8)
(entmod (subst (cons 11 (polar dxf_11 (angle dxf_11 dxf_10) rad)) (assoc 11 dxf_ent) dxf_ent))
)
)
)
)
)
)
)
)
(if (eq mod_sel "All") (command "_.zoom" "_previous"))
)
)
(prin1)
)