Author Topic: plot : shade plot & quality  (Read 2064 times)

0 Members and 1 Guest are viewing this topic.

domenicomaria

  • Swamp Rat
  • Posts: 725
plot : shade plot & quality
« on: December 21, 2023, 10:09:25 AM »
is there a way, via lisp, to set
"shade plot" to "as displayed"
and
"quality" as "maximum" ?

PKENEWELL

  • Bull Frog
  • Posts: 319
Re: plot : shade plot & quality
« Reply #1 on: December 21, 2023, 12:18:26 PM »
For ShadePlot: Right from AutoCAD's Help Documentation:

https://help.autodesk.com/view/OARX/2024/ENU/?guid=GUID-911E01F5-B5A6-4331-B860-FAB1E7E124C2

Code - Auto/Visual Lisp: [Select]
  1. (defun c:Example_ShadePlot()
  2.     ;; This example creates a paper space viewport,
  3.     ;; makes it active, and then sets it to plot as displayed.
  4.     (setq acadObj (vlax-get-acad-object))
  5.     (setq doc (vla-get-ActiveDocument acadObj))
  6.  
  7.     (setq centerPoint (vlax-3d-point 30 30 0)
  8.           width 40
  9.           height 40)
  10.    
  11.     ;; Create a paper space Viewport object
  12.     (vla-put-ActiveSpace doc acPaperSpace)
  13.  
  14.     (setq paperSpace (vla-get-PaperSpace doc))
  15.     (setq newPViewport (vla-AddPViewport paperSpace centerPoint width height))
  16.  
  17.     (vla-ZoomAll acadObj)
  18.     (vla-Display newPViewport :vlax-true)
  19.     (vla-put-MSpace doc :vlax-true)
  20.  
  21.     ;; Set the viewport to plot as displayed
  22.     (vla-put-ActivePViewport doc newPViewport)
  23.     (vla-put-ShadePlot newPViewport acShadePlotAsDisplayed)
  24. )
  25.  

Not sure about Quality Yet - I'll keep looking.
"When you are asked if you can do a job, tell 'em, 'Certainly I can!' Then get busy and find out how to do it." - Theodore Roosevelt

domenicomaria

  • Swamp Rat
  • Posts: 725
Re: plot : shade plot & quality
« Reply #2 on: December 21, 2023, 12:44:19 PM »
(vla-put-ShadePlot newPViewport acShadePlotAsDisplayed)

Ok
Thank you

For the quality I will wait...

PKENEWELL

  • Bull Frog
  • Posts: 319
Re: plot : shade plot & quality
« Reply #3 on: December 22, 2023, 11:19:36 AM »
(vla-put-ShadePlot newPViewport acShadePlotAsDisplayed)

Ok
Thank you

For the quality I will wait...

Sorry on the Shaded Viewport Quality value. I can't find much on this in relation to AutoLISP. Someone else may have more information.
"When you are asked if you can do a job, tell 'em, 'Certainly I can!' Then get busy and find out how to do it." - Theodore Roosevelt

domenicomaria

  • Swamp Rat
  • Posts: 725
Re: plot : shade plot & quality
« Reply #4 on: December 22, 2023, 12:16:59 PM »
I also searched but with no useful results...

it's something about plot resolution
« Last Edit: December 22, 2023, 12:20:23 PM by domenicomaria »

VovKa

  • Water Moccasin
  • Posts: 1631
  • Ukraine
Re: plot : shade plot & quality
« Reply #5 on: December 22, 2023, 01:15:58 PM »
Code: [Select]
(setq lst (entget (cdadr (member (cons 3 (getvar "CTAB")) (dictsearch (namedobjdict) "ACAD_LAYOUT")))))
(entmod (subst (cons 77 4) (assoc 77 lst) lst))

domenicomaria

  • Swamp Rat
  • Posts: 725
Re: plot : shade plot & quality
« Reply #6 on: December 23, 2023, 02:37:49 AM »
Code - Auto/Visual Lisp: [Select]
  1.    (setq lo-lst (entget (cdadr (member (cons 3 (getvar "CTAB")) (dictsearch (namedobjdict) "ACAD_LAYOUT")))) )
  2.  
  3.    ;   SHADEPLOT mode   :   0 = AS DISPLAYED
  4.    (setq lo-lst (subst (cons 76 0) (assoc 76 lo-lst) lo-lst) )
  5.  
  6.    ;   QUALITY   :   4 = MAXIMUM
  7.    (setq lo-lst (subst (cons 77 4) (assoc 77 lo-lst) lo-lst) )
  8.      
  9.    (entmod lo-lst)

thanks to VovKa too !


in any way I would like to know if it is possible to do the same (always in model space) with the vla-xxxx functions

« Last Edit: December 23, 2023, 08:36:18 AM by domenicomaria »

xdcad

  • Bull Frog
  • Posts: 493
Re: plot : shade plot & quality
« Reply #7 on: January 03, 2024, 06:28:26 PM »
Code - Auto/Visual Lisp: [Select]
  1.    (setq lo-lst (entget (cdadr (member (cons 3 (getvar "CTAB")) (dictsearch (namedobjdict) "ACAD_LAYOUT")))) )
  2.  
  3.    ;   SHADEPLOT mode   :   0 = AS DISPLAYED
  4.    (setq lo-lst (subst (cons 76 0) (assoc 76 lo-lst) lo-lst) )
  5.  
  6.    ;   QUALITY   :   4 = MAXIMUM
  7.    (setq lo-lst (subst (cons 77 4) (assoc 77 lo-lst) lo-lst) )
  8.      
  9.    (entmod lo-lst)

thanks to VovKa too !


in any way I would like to know if it is possible to do the same (always in model space) with the vla-xxxx functions

Code - Auto/Visual Lisp: [Select]
  1. (setq ent (cadr (xdrx-layout-getcurrent)))
  2. (setq quality 0); 0-5
  3. (xdrx-setpropertyvalue ent "ShadePlotResLevel" quality)
The code I wrote uses XDRX-API,which can be downloaded from github.com and is updated at any time.
===================================
https://github.com/xdcad
https://sourceforge.net/projects/xdrx-api-zip/
http://bbs.xdcad.net