Adding a scale bar and north arrow linked to a viewport to paperspace

Is there any way of having a scale bar and a north arrow linked to a viewport, so they update based on standard scale and viewport rotation?

Comments

  • You could probably do this via .NET or BRX code. Not trivial though

  • Rotate north arrow. Change "Northn"

    ;; Rotate a block in pspace to match world in model
    ; By Alan H Aug 2020

    (defun c:roblknth ( / ss ssv obj ang layname x)
    (foreach layname (Layoutlist)
    (setvar 'ctab layname)
    (command "._PSPACE")
    (setq ssv (ssget "X" (list (cons 0 "VIEWPORT")(cons 410 (getvar 'ctab)))))
    (if (= ssv nil)
    (alert "No viewports found \nWill now exit ")
    (repeat (setq x (sslength ssv))
    (setq obj (vlax-ename->vla-object (ssname ssv (setq x (1- x)))))
    (setq ang (vlax-get obj 'TwistAngle))
    (setq ss (ssget "x" (list (cons 0 "INSERT")(cons 2 "Northn")(cons 410 (getvar 'ctab)))))
    (if (= ss nil)
    (princ)
    (vla-put-rotation (vlax-ename->vla-object (ssname ss 0)) ang)
    )
    )
    )
    )
    (princ)
    )
    (c:roblknth)

    Similar for scale bar read Customscale from Viewport properties and insert correct block etc.