Visual LISP, AutoLISP and General Customization
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
Plot Transparen cy option in PLOT dialog box
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Hi,
Is anybody knows where else do they keep this setting?
I only have found it in Active Layout in extended dada
(entget (vlax-vla-object->ename(vla-get-activelayout (vla-get-activedocument(vlax-get-acad-object)))) '("*"))
The last pice of extended data is:
("PLOTTRANSPARENCY" (1071 . 0))
When i change it to 1
(setq layout(vla-get-activelayout (vla-get-activedocument(vlax-get-acad-object))))
(vla-getXdata layout "PLOTTRANSPARENCY" 'type 'data)
(vlax-safearray-fill data '("PLOTTRANSPARENCY" 1))
(vla-setXdata layout type data)
it stays there (extended data), but the setting in Plot dialog box doesn't change!!! And it still prints no transparency.
It takes to save the drawing and reopen it again to see the change.
Where else could it be??
The command -PLOT does not have this setting as well, so my options back to VBA or Lisp, but HOW??
Solved! Go to Solution.
Re: Plot Transparen cy option in PLOT dialog box
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Hi,
take a look to acad-system-variable PLOTTRANSPARENCYOVERRIDE.
Maybe this would be a easier way and helpful for you.
kind regards,
Franz
Re: Plot Transparen cy option in PLOT dialog box
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
This variable is ACAD depended, it is not stored in the drawing and makes changes in all opened drawings. Additionally it overrides setting of all layouts.
Re: Plot Transparen cy option in PLOT dialog box
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
OK,
now i am curious about this ...
I am not so familar with VLAX-..., but i try it with similar lisp ... and it works!
Here is my pure lisp code for testing:
Note: Entity-list elist_modellayout the applist '(-3 ("ACAD_PSEXT" ...)' must exist.
(defun c:tplot () ;----- Dictionary lesen
(setq elist_dict (dictsearch (namedobjdict) "ACAD_LAYOUT")) (setq elist_modellayout (entget (cdr (car (cdr (member (cons 3 "Model") elist_dict)))) '("*"))) (setq list_psext (assoc -3 elist_modellayout)) ;----- Plot transparent (setq list_psext-neu (subst (list "PLOTTRANSPARENCY" '(1071 . 1)) (assoc "PLOTTRANSPARENCY" (cdr list_psext)) list_psext)) (setq elist_modellayout-neu (subst list_psext-neu list_psext elist_modellayout)) (entmod elist_modellayout-neu) ;;; ;----- Plot wieder ohne transparent Option ;;; (setq list_psext-neu (subst (list "PLOTTRANSPARENCY" '(1071 . 0)) (assoc "PLOTTRANSPARENCY" (cdr list_psext)) list_psext)) ;;; (setq elist_modellayout-neu (subst list_psext-neu list_psext elist_modellayout)) ;;; (entmod elist_modellayout-neu) );enddefun
Last part is to set plot option back to normal (without transp.)
Re: Plot Transparen cy option in PLOT dialog box
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Of course, how did i missed it , it has to be (entmod...
(entmod(entget (vlax-vla-object->ename(vla-get-activelayout (vla-get-activedocument(vlax-get-acad-object)))) '("*")))
I guess my excuse is that I wrote in VBA first and then translated it to VLisp.
I would assume that it is a bug of VBA and automation. There is no such a thing as (entmod in VBA
Thanks kefer
Re: Plot Transparen cy option in PLOT dialog box
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
In some layouts is no "PLOTTRANSPARENCY"...
This script (princ (entget (vlax-vla-object->ename(vla-get-activelayout (vla-get-activedocument(vlax-get-acad-object)))) '("*"))) prompts:
((-1 . <Entity name: 7ffff633e30>) (0 . LAYOUT) (5 . 15503) (102 .
{ACAD_XDICTIONARY) (360 . <Entity name: 7ffff634d30>) (102 . }) (102 .
{ACAD_REACTORS) (330 . <Entity name: 7ffff6090d0>) (102 . }) (330 . <Entity
name: 7ffff6090d0>) (100 . AcDbPlotSettings) (1 . ) (2 . Albert hp5200tn.pc3)
(4 . A3) (40 . 6.01133) (41 . 4.23334) (42 . 6.01135) (43 . 4.23334) (44 .
296.968) (45 . 419.989) (46 . -6.02718) (47 . -4.23885) (48 . -1.13687e-013)
(49 . -5.68434e-014) (140 . 420.0) (141 . 297.0) (142 . 1.0) (143 . 1.0) (70 .
694) (72 . 1) (73 . 1) (74 . 4) (7 . Dunne lijnen.ctb) (75 . 16) (147 . 1.0)
(76 . 1) (77 . 2) (78 . 150) (148 . 1.13687e-013) (149 . 5.68434e-014) (100 .
AcDbLayout) (1 . Winkel op A3) (70 . 0) (71 . 2) (10 0.00550842 0.0158482 0.0)
(11 419.994 296.984 0.0) (12 0.0 0.0 0.0) (14 -1.13687e-013 -5.68434e-014 0.0)
(15 420.0 297.0 0.0) (146 . 0.0) (13 0.0 0.0 0.0) (16 1.0 0.0 0.0) (17 0.0 1.0
0.0) (76 . 0) (330 . <Entity name: 7ffff633da0>) (331 . <Entity name:
7ffff633dc0>) (-3 (ACAD_PSEXT (1000 . Albert hp5200tn.pc3) (1000 . HP Universal
Printing PCL 6) (1000 . Renswoude) (1000 . formulemanagement_hp5200tn) (1070 .
0))))
My script doesn't work!!!:
(defun tplot ()
(vl-load-com)
(setq elist_modellayout (entget (vlax-vla-object->ename(vla-get-activelayout (vla-get-activedocument(vlax-get-acad-object)))) '("*")))
(setq list_psext (assoc -3 elist_modellayout))
(if (/= (assoc "PLOTTRANSPARENCY" (cdr (assoc -3 elist_modellayout))) nil)
(progn
(setq list_psext-neu (subst (list "PLOTTRANSPARENCY" '(1071 . 1)) (assoc "PLOTTRANSPARENCY" (cdr list_psext)) list_psext))
(setq elist_modellayout-neu (subst list_psext-neu list_psext elist_modellayout))
(entmod elist_modellayout-neu)
)
(setq list_psext-neu (append (list -3) (list (assoc "ACAD_PSEXT" (cdr (assoc -3 elist_modellayout)))) (list (list "PLOTTRANSPARENCY" '(1071 . 1))) ))
)
)
Re: Plot Transparen cy option in PLOT dialog box
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
I’m searching for a lisp that turns on the plottransparency in all my layouts. Note: in some of my layout tabs is no ("PLOTTRANSPARENCY" (1071 . 0)). How do i modify the definition data of a layout with entmod?
Can i change the definition data of a layout from:
(
(-1 . <Entity name: 7fffea60d20>)
(0 . "LAYOUT")
……..
(331 . <Entity name: 7fffea60df0>)
(-3
("ACAD_PSEXT"
(1000 . "Microsoft XPS Document Writer")
(1000 . "Microsoft XPS Document Writer")
(1000 . "XPSPort:")
(1000 . "")
(1070 . 0)
)
)
)
To: ???
(
(-1 . <Entity name: 7fffea60d20>)
(0 . "LAYOUT")
……..
(331 . <Entity name: 7fffea60df0>)
(-3
("ACAD_PSEXT"
(1000 . "Microsoft XPS Document Writer")
(1000 . "Microsoft XPS Document Writer")
(1000 . "XPSPort:")
(1000 . "")
(1070 . 0)
)
("PLOTTRANSPARENCY" (1071 . 1))
)
)
I think the lisp is something like this:
(defun tplot ()
(vl-load-com)
(setq elist_modellayout (entget (vlax-vla-object->ename(vla-get-activelayout (vla-get-activedocument(vlax-get-acad-object)))) '("*")))
(setq list_psext (assoc -3 elist_modellayout))
(if (/= (assoc "PLOTTRANSPARENCY" (cdr (assoc -3 elist_modellayout))) nil)
(progn
(setq list_psext-neu (subst (list "PLOTTRANSPARENCY" '(1071 . 1)) (assoc "PLOTTRANSPARENCY" (cdr list_psext)) list_psext))
(setq elist_modellayout-neu (subst list_psext-neu list_psext elist_modellayout))
(entmod elist_modellayout-neu)
)
(progn
(setq list_psext-neu (append (list -3) (list (assoc "ACAD_PSEXT" (cdr (assoc -3 elist_modellayout)))) (list (list "PLOTTRANSPARENCY" '(1071 . 1))) ))
(setq elist_modellayout-neu (subst list_psext-neu list_psext elist_modellayout))
(entmod elist_modellayout-neu)
)
)
)
Thanks
Re: Plot Transparen cy option in PLOT dialog box
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
I think you have forgotten the tird option, no extended data at all.
Re: Plot Transparen cy option in PLOT dialog box
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
(defun tplot ()
(princ "(TPLOT) ")
(vl-load-com)
(setq elist_modellayout (entget (vlax-vla-object->ename (vla-get-activelayout (vla-get-activedocument(vlax-get-acad-object)))) '("*")))
(setq list_psext (assoc -3 elist_modellayout))
(if (/= (assoc "PLOTTRANSPARENCY" (cdr (assoc -3 elist_modellayout))) nil)
(progn
(setq list_psext-neu (subst
'("PLOTTRANSPARENCY" (1071 . 1))
(assoc "PLOTTRANSPARENCY" (cdr list_psext))
list_psext
))
(setq elist_modellayout-neu (subst list_psext-neu list_psext elist_modellayout))
(entmod elist_modellayout-neu)
)
(progn
(setq elist_modellayout-neu (subst
(list -3 (cadr list_psext) '("PLOTTRANSPARENCY" (1071 . 1)))
(list -3 (cadr list_psext))
elist_modellayout
))
(entmod elist_modellayout-neu)
)
)
)
(Defun c:pp ()
(if (not (tplot))
(prompt "WARNING: PLOTTRANPARANCY NOT SET")
)
)
I can not get it working... In some drawings i can not set de plottranparency with lisp!! Who can help?
Re: Plot Transparen cy option in PLOT dialog box
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Well, i couldn't make it any simpler. You don't have to check if the "PLOTTRANSPARENCY" is there, just dump it in.
;;; arg1 - any layout
;;; arg2 - torn on/off 0 or 1
;;; return - Extended Entity Data
;;; call - (LayoutTransparensy (vla-get-activelayout (vla-get-activedocument(vlax-get-acad-object))) 1)
(defun LayoutTransparensy (layout ON / xType xData )
(setq xData (vlax-make-safearray vlax-vbVariant '(0 . 1)))
(setq xType (vlax-make-safearray vlax-vbInteger '(0 . 1)))
(vlax-safearray-fill xData (list(vlax-make-variant "PLOTTRANSPARENCY")(vlax-make-variant ON)))
(vlax-safearray-fill xType (list 1001 1071))
(vla-setXdata layout xType xData)
(entmod(entget (vlax-vla-object->ename layout) '("*")))
)


