Is plot transparency setting stored in named page setups?

Is plot transparency setting stored in named page setups?

JamesMaeding
Advisor Advisor
471 Views
4 Replies
Message 1 of 5

Is plot transparency setting stored in named page setups?

JamesMaeding
Advisor
Advisor

Hi All,

I read a few posts saying its stored as xdata on each layout.

Then, you have the PLOTTRANSPARENCYOVERRIDE variable.

I keep PLOTTRANSPARENCYOVERRIDE at 1, so from help:

"Uses the setting specified in the Page Setup or the Plot dialog boxes"

I agree checking the box works. You apply to layou, close, reopen plot dialog, its how you left it.

But, if I choose a named page setup, it unchecks.

That tells me, and the help says, its also in the named page setup.

Why do I care? I have tools that manipulate the named page setups so need to set that setting correctly.

I'll do some checking as I am starting to suspect the named page setup also has xdata with that setting.

Any help appreciated though.

thanks,

 


internal protected virtual unsafe Human() : mostlyHarmless
I'm just here for the Shelties

0 Likes
Accepted solutions (1)
472 Views
4 Replies
Replies (4)
Message 2 of 5

CodeDing
Advisor
Advisor
Accepted solution

@JamesMaeding ,

 

My quick testing shows that, yes, the transparency is stored as XData on the page setup:

image.png

 

Now, with that being said, if  the user uses the "Plot" dialog box and they check/uncheck that box, it overrides the page setup and the transparency is stored as XData in the layout:

image.png

Message 3 of 5

JamesMaeding
Advisor
Advisor

@CodeDing 

Awesome.

Many thanks from MaeDing!


internal protected virtual unsafe Human() : mostlyHarmless
I'm just here for the Shelties

0 Likes
Message 4 of 5

alteixeiraFTNE7
Observer
Observer

HI
I am a rookie. Can you help me access the  pagesetup ... and then access its Xdata

Thanks

 

Alberto

0 Likes
Message 5 of 5

CodeDing
Advisor
Advisor

@alteixeiraFTNE7 ,

 

This should be helpful enough to get you where you need.

It retrieves Named Page Setups, then displays their Plot Transparency state.

BUT REMEMBER (as I stated in my first message) :


@CodeDing wrote:

...if the user uses the "Plot" dialog box and they check/uncheck that box, it overrides the page setup and the transparency is stored as XData in the layout


Here's the code:

;; Retrieves Named Page Setups
;; Displays their Plot Transparency state
(defun c:TEST ( / dictPlotSettings psn psd namedPageSetups str eg plotTransparent)
  (setq dictPlotSettings (dictsearch (namedobjdict) "ACAD_PLOTSETTINGS"))
  (foreach item dictPlotSettings
    (cond
      ((= 3 (car item)) (setq psn (cdr item)))   ;; page setup name
      ((= 350 (car item)) (setq psd (cdr item))) ;; page setup dict
    );cond
    (if (and psn psd)
      (setq namedPageSetups (cons (cons psn psd) namedPageSetups) psn nil psd nil)
    );if
  );foreach
  (if (null namedPageSetups)
    (progn (prompt "\nNo Named Page Setups found.") (exit))
  );if
  ;; For the purposes of an example, I will select the FIRST named page setup
  ;; The 'namedPageSetups' list looks like this:
  ;; (("Page Setup A" . <dict-ename>) ("Page Setup B" . <dict-ename>) ...)
  (setq nps (car namedPageSetups))
  ;; Loop through named page setups
  (setq str "")
  (foreach nps namedPageSetups
    ;; get page setup with Extended Data for PLOTTRANSPARENCY
    (setq eg (entget (cdr nps) '("PLOTTRANSPARENCY")))
    ;; Retrieve Plot Transparency as bool
    (setq plotTransparent (not (zerop (cdr (assoc 1071 (cdadr (assoc -3 eg)))))))
    (setq str
      (strcat str
        "\nPlot Transparency for '" (car nps) "': " (if plotTransparent "ENABLED" "DISABLED")
      );strcat
    );setq
  );foreach
  (alert (princ str))
  (princ)
);defun

 

Screenshot of result:

image.png

 

Best,

~DD

0 Likes