Author Topic: Select all viewports (LM:movetobottom)  (Read 137 times)

0 Members and 1 Guest are viewing this topic.

lamarn

  • Swamp Rat
  • Posts: 601
Select all viewports (LM:movetobottom)
« on: October 03, 2019, 05:30:11 PM »
Hi i am trying to set all my viewports back or front
Based on this code of Lee Mac.

(LM:movetobottom (ssget "x"  (0 . "VIEWPORT")))
(LM:movetotop (ssget "x"  (0 . "VIEWPORT")))

Why doesn't this work, is this an invalid input?

error: Automation Error. Invalid input

http://www.lee-mac.com/draworderfunctions.html




Design is something you should do with both hands. My 2d hand , my 3d hand ..

Lee Mac

  • Seagull
  • Posts: 12267
  • London, England
Re: Select all viewports (LM:movetobottom)
« Reply #1 on: October 03, 2019, 05:52:17 PM »
You will need to exclude Modelspace viewports and the Paperspace viewport itself; you are also missing a couple of parentheses and a quote preceding the ssget filter list. You will also need to operate on each layout at a time since my functions assume the objects have the same owner.

For example:
Code - Auto/Visual Lisp: [Select]
  1. (LM:movetobottom (ssget "_X" (list '(0 . "VIEWPORT") (cons 410 (getvar 'ctab)) '(-4 . "<>") '(69 . 1))))

lamarn

  • Swamp Rat
  • Posts: 601
Re: Select all viewports (LM:movetobottom)
« Reply #2 on: October 04, 2019, 03:04:05 AM »
Thank you very much.
If tried to use your commands a couple of times but i think "move to top" / "move to bottom" gives other results than "draworder back/front"

Anyway, this works for me now.

(command "draworder" (ssget "_X" (list '(0 . "VIEWPORT") (cons 410 (getvar 'ctab)) '(-4 . "<>") '(69 . 1))) "" "back")

Design is something you should do with both hands. My 2d hand , my 3d hand ..