- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi, I am going a little potty over something simple. I found a nice lisp that puts the viewport rotation into a north block which works fine when there is a plain viewport, but if you have a polygonal viewport it gets confused between the defining polyline and the viewport so I tried to get it to selection set only the viewport but I am getting ; error: bad argument type: lentityp nil error. I am using AutoCAD 2016 and Civil3D 2016.
(defun c:rn()
(prompt "\nSelect Objects by Window") ; my tweek
(setq tw (ssget '((0 . "VIEWPORT")))); my tweek
(setq tw (ssadd ent tw)); my tweek
;(setq tw(entget(car(entsel" Select a Viewport:")))) ;original code
(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(car(entsel" Select North Arrow: ")))
(setq elist(entget en))
(setq elist(subst (cons 50 rt)(assoc 50 elist) elist))
(entmod elist)
(princ)
)
Hope you can help.
Solved! Go to Solution.