VP Lineweight

VP Lineweight

christopher.l.evans
Advocate Advocate
1,057 Views
1 Reply
Message 1 of 2

VP Lineweight

christopher.l.evans
Advocate
Advocate

Does anyone have any examples using ADSK_XREC_LAYER_LINEWT_OVR.  I have some older drawings that didn't use a VP Scale of 1:1 and I'd like to get the VP Scale and loop through the VPs to set the VP Lineweights based off the VP Scale.

0 Likes
1,058 Views
1 Reply
Reply (1)
Message 2 of 2

Ranjit_Singh
Advisor
Advisor

Just for example

(defun somefunc  (lan / ltord vphand)
 (if (zerop (getvar 'tilemode))
  (progn (setq vphand (cdr (assoc 5 (entget (ssname (ssget "_x" (list '(0 . "VIEWPORT") (cons 410 (getvar 'ctab)) (cons 69 (caar (vports))))) 0)))))
         (if (setq ltord (member '(3 . "ADSK_XREC_LAYER_LINEWT_OVR")
                                 (entget (cdr (assoc 360 (entget (tblobjname "layer" lan)))))))
          (princ
           (strcat (rtos (/ (cdr (assoc vphand (vl-remove nil (mapcar '(lambda (x y z)
                                                             (if (equal x '(102 . "{ADSK_LYR_LINEWT_OVERRIDE"))
                                                              (cons (cdr (assoc 5 (entget (cdr y)))) (cdr z))))
                                                           (setq ltord (entget (cdr (assoc 360 ltord))))
                                                           (cdr ltord)
                                                           (cddr ltord))))) 100.0) 2 2) " mm"))
          (princ "\nNo Lineweight Override detected"))))
 (princ))

Lineweight_Override.gif

 

0 Likes