Lisp to bulk rotate north arrows based on specific Viewport

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
Im pretty New to Lisps, Trying to get the below working. I have about 200 drawings and i want to update all the north arrows as multiple views have changed, i can right a script to delete the old arrows and insert a new one in the paper space just trying to sort out a bit of lisp routine to rotate the new north arrow based on the main viewport (i have 2 in each drawing)
This is what I have:
(setq tw(entget(car(ssget "_F" '((280 565) (270 575)) '((0 . "VIEWPORT"))))))
(setq new (cdr (assoc 0 tw)))
(cond
((= new "VIEWPORT")(setq rt(cdr(assoc 51 tw))))
((= new "LWPOLYLINE")(setq temp (entget(cdr (assoc 330 tw))))(setq rt(cdr(assoc 51 temp))))
)
(setq en(ssname (ssget "X" (LIST (CONS 0 "INSERT")(CONS 2 "NORTH_ARROW")) 0)))
(setq elist(entget en))
(setq elist(subst (cons 50 rt)(assoc 50 elist) elist))
(entmod elist)
(princ)
)