Author Topic: Delete Mviews via Command line  (Read 1741 times)

0 Members and 1 Guest are viewing this topic.

MSTG007

  • Gator
  • Posts: 2601
  • I can't remeber what I already asked! I need help!
Delete Mviews via Command line
« on: March 17, 2015, 04:12:49 PM »
How can you erase / delete a viewport in on current layout tab thru the command line without a user using a mouse to select it?
Civil3D 2020

ChrisCarlson

  • Guest
Re: Delete Mviews via Command line
« Reply #1 on: March 17, 2015, 04:26:02 PM »
view, select named view, delete?

MSTG007

  • Gator
  • Posts: 2601
  • I can't remeber what I already asked! I need help!
Re: Delete Mviews via Command line
« Reply #2 on: March 17, 2015, 04:29:59 PM »
Is there a way to type (*) since I do not know what the mview name would be?
Civil3D 2020

mjfarrell

  • Seagull
  • Posts: 14444
  • Every Student their own Lesson
Re: Delete Mviews via Command line
« Reply #3 on: March 17, 2015, 04:45:21 PM »
qselect
Be your Best


Michael Farrell
http://primeservicesglobal.com/

ROBBO

  • Bull Frog
  • Posts: 217
Re: Delete Mviews via Command line
« Reply #4 on: March 18, 2015, 04:39:42 AM »
(ssget "x" '((0 . "VIEWPORT")))(command ".ERASE" "p" "")
The only thing to do with good advice is to pass it on.
It is never of any use to oneself.

Oscar Wilde
(1854-1900, Irish playwright, poet and writer)

MSTG007

  • Gator
  • Posts: 2601
  • I can't remeber what I already asked! I need help!
Re: Delete Mviews via Command line
« Reply #5 on: March 18, 2015, 08:18:32 AM »
Thank you so much!

Code: [Select]
(defun c:vpdelc nil
  (if (ssget "_x" (list '(0 . "VIEWPORT") (cons 410 (getvar 'ctab))))
    (command "_erase" "p" "" "")
  )
)
Civil3D 2020

ChrisCarlson

  • Guest
Re: Delete Mviews via Command line
« Reply #6 on: March 18, 2015, 08:42:01 AM »
Seems a little dangerous as this would delete all? What would even be the purpose of delete all?

MSTG007

  • Gator
  • Posts: 2601
  • I can't remeber what I already asked! I need help!
Re: Delete Mviews via Command line
« Reply #7 on: March 18, 2015, 08:47:46 AM »
I was trying to get it to delete the mview on the current tab only.
Civil3D 2020

cadtag

  • Swamp Rat
  • Posts: 1152
Re: Delete Mviews via Command line
« Reply #8 on: March 18, 2015, 11:34:52 AM »
Seems a little dangerous as this would delete all? What would even be the purpose of delete all?

well, April 1st is coming.... gotta have some random gag
The only thing more dangerous to the liberty of a free people than big government is big business