See the top rated post in this thread. Click here

Results 1 to 10 of 13

Thread: Lisp to "Display plot styles" on open

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Member
    Join Date
    2006-07
    Posts
    2
    Login to Give a bone
    0

    Default Lisp to "Display plot styles" on open

    Hi all! I'm hoping someone might be able to help me with a Lisp routine. I would like to have a Lisp that could change all layouts to "Display plot styles" on open. I have a couple Lisps already that get me pretty close but I was hoping that someone would be able to combine the two somehow.

    I'm running Civil3D 2011 on Win7-64


    I found this Lisp somewhere on this forum. I think originally it unchecked the "display plot styles" but I changed it to do the opposite. I turned it into a button, but its a manual button press and it only works on the current tab.

    Code:
    (defun pstyleDOshow (/ doc layoutobj)
      (setq	doc	  (vla-get-activedocument
    		    (vlax-get-acad-object)
    		  )
    	layoutobj (vla-get-activelayout doc)
      )
      (vla-put-showplotstyles layoutobj :vlax-true)
      (vla-regen doc acAllViewports)
      (mapcar 'vlax-release-object (list layoutobj doc))
      (princ)
    )

    Then I have this Lisp to lock all viewports in an drawing automatically after opening a drawing. I just add this to my startup suite and it works great!

    Code:
    ;;;VPLOCK.lsp locks all viewports automatically when opening a drawing
    ;;;no idea who wrote it
    
    (defun vplock (yesno / ss lock x obj)
      (vl-load-com)
      (if (setq ss (ssget "X" '((0 . "VIEWPORT")(-4 . "/=")(69 . 1))))
        (progn
          (if (= "y" yesno) (setq lock :vlax-true)(setq lock :vlax-false))
          (setq x 0)
          (while (< x (sslength ss))
         (setq obj (vlax-ename->vla-object (ssname ss x)))
         (vla-put-displaylocked obj lock)
         (setq x (1+ x))
         )
          )
        )
      (princ)
      )
    (vplock "y")
    So I don't know if a combination of these two would work, but I thought I'd include both just in case it helps. Ultimately what I need is a way to change all viewports in a drawing to "display plot styles" every time I open a drawing. Is this possible? I've been trying to figure this out on my own for a while but I'm not that great at programing so I haven't been able to make it work correctly. I would really appreciate any help on this. Thanks!
    Last edited by rkmcswain; 2011-04-26 at 04:21 PM. Reason: added CODE tags

Similar Threads

  1. Replies: 8
    Last Post: 2012-08-18, 01:31 AM
  2. Plot Styles Change "Normal" globaly in layer dialog
    By elowe494 in forum VBA/COM Interop
    Replies: 14
    Last Post: 2012-01-11, 02:18 AM
  3. Replies: 5
    Last Post: 2009-04-17, 10:10 AM
  4. "SketchUp" like display styles
    By revit.wishlist1942 in forum Revit Architecture - Wish List
    Replies: 0
    Last Post: 2008-07-04, 11:38 AM
  5. Replies: 8
    Last Post: 2007-04-04, 12:39 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •