Author Topic: Modle Tab: ShowPlotStyles?  (Read 1349 times)

0 Members and 1 Guest are viewing this topic.

cadman6735

  • Guest
Modle Tab: ShowPlotStyles?
« on: July 11, 2011, 01:19:03 PM »
Why does this not work?  Thanks in advance

Code: [Select]
(defun c:test ( / )

  (setq
    acadObject (vlax-get-acad-object)
    acadActiveDocument (vla-get-ActiveDocument acadObject)
    acadModelSpace (vla-get-ModelSpace acadActiveDocument)
    acadModelLayout (vla-get-Layout acadModelSpace)
  )

  (if
    (eq vla-get-ShowPlotStyles acadModelLayout :vlax-true)
    (vla-put-ShowPlotStyles acadModelLayout :vlax-false)

  )


(princ)

)

Lee Mac

  • Seagull
  • Posts: 12928
  • London, England
Re: Modle Tab: ShowPlotStyles?
« Reply #1 on: July 11, 2011, 01:26:03 PM »
First thing I noticed was a missed parenthesis:

Code: [Select]
  (if
    (eq vla-get-ShowPlotStyles acadModelLayout :vlax-true)
    (vla-put-ShowPlotStyles acadModelLayout :vlax-false)

  )

Code: [Select]
  (if
    (eq (vla-get-ShowPlotStyles acadModelLayout) :vlax-true)
    (vla-put-ShowPlotStyles acadModelLayout :vlax-false)

  )

But FWIW, you might as well just set the property without the check since you will be setting it to that value anyway:

Code: [Select]
(vla-put-ShowPlotStyles acadModelLayout :vlax-false)

cadman6735

  • Guest
Re: Modle Tab: ShowPlotStyles?
« Reply #2 on: July 11, 2011, 01:52:30 PM »
Thanks Lee

I had 2008 open and 2012 open with the Lisp editor for both open at the same time,  I was using the 2008 AutoLisp and trying to load my code into the 2012 drawing enviroment.  When your code didn't work I knew there was more to my story.  This is why I didn't see any errors with the code when it ran it...
 :ugly: :ugly: :ugly: