Author Topic: Current shademode?  (Read 3051 times)

0 Members and 1 Guest are viewing this topic.

CLIMBCUTTER

  • Mosquito
  • Posts: 10
Current shademode?
« on: October 10, 2012, 11:02:29 AM »
Can one get Acad's current shademode without hacking the return from the command?

Lee Mac

  • Seagull
  • Posts: 12926
  • London, England
Re: Current shademode?
« Reply #1 on: October 10, 2012, 02:51:29 PM »
Hint:

Code - Auto/Visual Lisp: [Select]
  1.     (assoc
  2.         (cdr
  3.             (assoc 281
  4.                 (entget
  5.                     (vlax-vla-object->ename
  6.                         (
  7.                             (if (= 1 (getvar 'tilemode))
  8.                                 vla-get-activeviewport
  9.                                 vla-get-activepviewport
  10.                             )
  11.                             (vla-get-activedocument (vlax-get-acad-object))
  12.                         )
  13.                     )
  14.                 )
  15.             )
  16.         )
  17.        '(
  18.             (0 . "2D Optimized (classic 2D)")
  19.             (1 . "Wireframe")
  20.             (2 . "Hidden line")
  21.             (3 . "Flat shaded")
  22.             (4 . "Gouraud shaded")
  23.             (5 . "Flat shaded with wireframe")
  24.             (6 . "Gouraud shaded with wireframe")
  25.         )
  26.     )
  27. )

ronjonp

  • Needs a day job
  • Posts: 7531
Re: Current shademode?
« Reply #2 on: October 10, 2012, 03:23:23 PM »
In AutoCAD 2013 this seems to work:

Code - Auto/Visual Lisp: [Select]
  1.             (entget (cdr (assoc 348
  2.                                 (entget (vlax-vla-object->ename
  3.                                           ((if (= 1 (getvar 'tilemode))
  4.                                              vla-get-activeviewport
  5.                                              vla-get-activepviewport
  6.                                            )
  7.                                             (vla-get-activedocument (vlax-get-acad-object))
  8.                                           )
  9.                                         )
  10.                                 )
  11.                          )
  12.                     )
  13.             )
  14.      )
  15. )
« Last Edit: October 10, 2012, 03:52:08 PM by ronjonp »

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

Lee Mac

  • Seagull
  • Posts: 12926
  • London, England
Re: Current shademode?
« Reply #3 on: October 10, 2012, 03:30:57 PM »
In AutoCAD 2013 this seems to work:

Code: [Select]
...

Good call, works in 2010 also. :-)

ronjonp

  • Needs a day job
  • Posts: 7531
Re: Current shademode?
« Reply #4 on: October 10, 2012, 03:37:38 PM »
 8-)

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

ScottMC

  • Newt
  • Posts: 194
Re: Current shademode?
« Reply #5 on: February 05, 2022, 05:05:41 PM »
I have no calendar.. The only other way so far I've found was to flip in and out of paper space.

Code: [Select]

(defun  c:vs (/)
  ;; http://www.theswamp.org/index.php?topic=42966.msg608577#msg608577
  (setvar 'cmdecho 0)
  (setvar 'tilemode 0)
  (setvar 'tilemode 1)
 
  (vl-load-com)
  (defun shdmode nil
    (cdr
      (assoc
        (cdr
          (assoc 281
             (entget
               (vlax-vla-object->ename
                 (
                  (if (= 1 (getvar 'tilemode))
                    vla-get-activeviewport
                    vla-get-activepviewport
                  ) ;_ end of if
                   (vla-get-activedocument
                     (vlax-get-acad-object)
                   ) ;_ end of vla-get-activedocument
                 )
               ) ;_ end of vlax-vla-object->ename
             ) ;_ end of entget
          ) ;_ end of assoc
        ) ;_ end of cdr
        '(
          (0 . "2D Wireframe")
          (1 . "3D Wireframe")
          (2 . "Hidden line")
          (3 . "Flat shaded")
          (4 . "Gouraud shaded")
          (5 . "Flat shaded edges On")
          (6 . "Gouraud shaded edges On")
         )
      ) ;_ end of assoc
    ) ;_ end of cdr
  ) ;_ end of defun
  (setvar 'cmdecho 1)
  (shdmode)
) ;_ end of defun

« Last Edit: February 05, 2022, 07:12:33 PM by ScottMC »