0 Members and 2 Guests are viewing this topic.
(setq layEnt (entget (tblobjname "layer" "0")))(setq pltStyl (entget (cdr (assoc 390 layEnt))))
(vl-load-com)(setq doc (vla-get-activedocument(vlax-get-acad-object)) layobj(vla-item(vla-get-layers doc) "MyLayer"))(if layobj (setq style (vla-get-plotstylename layobj)))
....unless you are plotting by layer rather than by entity lineweight or color
(setq layEnt (entget (tblobjname "layer" "0")))(if (= 0 (getvar "pstylemode")) (progn (setq pltStyl (cdr (assoc 3 (entget (cdr (assoc 330 (entget (cdr (assoc 390 layEnt))))))))) ) (progn (setq pltStyl (strcat "Color_" (itoa (cdr (assoc 62 layEnt))))) ) )
((-1 . <Entity name: 1bb3930>) (0 . "ACDBPLACEHOLDER") (5 . "26") (102 . "{ACAD_REACTORS") (330 . <Entity name: 1bb3830>) (102 . "}") (330 . <Entity name: 1bb3830>))
_$ (assoc 390 layEnt)(390 . <Entity name: 1bb3930>)_$ ((-1 . <Entity name: 1bb3930>) (0 . "ACDBPLACEHOLDER") (5 . "26") (102 . "{ACAD_REACTORS") (330 . <Entity name: 1bb3830>) (102 . "}") (330 . <Entity name: 1bb3830>))_$ ((-1 . <Entity name: 1bb3830>) (0 . "ACDBDICTIONARYWDFLT") (5 . "6") (102 . "{ACAD_REACTORS") (330 . <Entity name: 1bb3838>) (102 . "}") (330 . <Entity name: 1bb3838>) (100 . "AcDbDictionary") (280 . 0) (281 . 1) (3 . "Heavy") (350 . <Entity name: 1bb3ba0>) (3 . "Light") (350 . <Entity name: 1bb3930>) (3 . "Medium") (350 . <Entity name: 1bb3a98>) (3 . "Normal") (350 . <Entity name: 1bb3828>) (3 . "vHeavy") (350 . <Entity name: 1bb3ba8>) (3 . "XHeavy") (350 . <Entity name: 1bb3aa0>) (3 . "xL_Scrn") (350 . <Entity name: 1bb6548>) (3 . "xLight") (350 . <Entity name: 1bb3ad8>) (3 . "xxLight") (350 . <Entity name: 1bb6550>) (100 . "AcDbDictionaryWithDefault") (340 . <Entity name: 1bb3828>))
(if (= 0 (getvar "pstylemode")) (progn (setq pltStylTbl (entget (cdr (assoc 330 (entget (cdr (assoc 390 layEnt))))))) (setq pos (vl-position (cons 350 (cdr (assoc 390 layEnt))) pltstyltbl)) (setq pltStyl (cdr (nth (1- pos) pltstyltbl))) ) (progn (setq pltStyl (strcat "Color_" (itoa (cdr (assoc 62 layEnt))))) ) )
(defun c:test () (setq layent (entget (tblobjname "layer" "0"))) (setq pltstyldict (entget (cdr (assoc 330 (entget (cdr (assoc 390 layent))))))) (if (setq tmp (member (cons 350 (cdr (assoc 390 layent))) (reverse pltstyldict))) (setq pltsty (cdr (assoc 3 tmp))) ))