i need help making my north arrow rotate with the viewport if anyone can help me that would be awesome
Solved! Go to Solution.
Solved by jmartt. Go to Solution.
I've made a button that uses this LISP file.
I didn't write this. It was probably Sam Lucido.
(defun c:rn()
(setq tw(entget(car(entsel" Select a 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(car(entsel" Select North Arrow: ")))
(setq elist(entget en))
(setq elist(subst (cons 50 rt)(assoc 50 elist) elist))
(entmod elist)
(princ)
)
Can you provide more details on your request? It seems that you have a custom arrow (not a built in), am I right?
To keep an AutoCAD entity from rotating with the view, you'll need to override (in C++) or overrule (in .NET) the ViewportDraw behavior to maintain the entity position regarding the view direction.
There is a basic implementation for this in C++ at http://adndevblog.typepad.com/autocad/2012/06/how-to-control-an-entity-viewportdraw-so-that-it-alway...
Is that the direction that you need?
The built-in AutoCAD arrow is not on the drawing, but a different type of image...
If you need yours on the drawing, then you need to manipulate it, at least that's my understanding...
Steve Hill
Civil Designer / .NET Developer
AutoCAD Certified Professional
AutoCAD Civil 3D Certified Professional
http://redtransitconsultants.com/
Autodesk Exchange Store
Twitter | LinkedIn
Please select the Accept this solution button if my post solves your issue or answers your question.