Author Topic: Error setting CVPORT  (Read 1826 times)

0 Members and 1 Guest are viewing this topic.

mkweaver

  • Bull Frog
  • Posts: 352
Error setting CVPORT
« on: December 26, 2014, 01:35:37 PM »
I am getting the following error when zoomed extents in a layout with 15 viewports:
Quote
Command: CVPORT
Enter new value for CVPORT <1>: 3
Cannot set CVPORT to that value.
*Invalid*

The layer is not locked, the viewport is.  Unlocking the viewport doesn't solve the problem.

From help:
Quote
Type:   Integer
Saved in:   Drawing
Initial value:   2
You can change this value, which changes the current viewport, if the following conditions are met:
The identification number you specify is that of an active viewport.
A command in progress has not locked cursor movement to that viewport.
Tablet mode is off.
MaxActVP is set to 64.
No command is active.
TABMODE is set to 0.

The objective:
  I have found that occasionally my annotative objects don't display/plot.  Activating the viewport, unlocking the scale, changing the scale, then changing it back solves the problem.  To automate this process I wrote this:
Code - Auto/Visual Lisp: [Select]
  1. (defun c:RegenAllDetails (/ doc)
  2.   (setvar "tilemode" 0)
  3.   (command "paperspace")
  4.   (mapcar
  5.     (function
  6.       (lambda (mv)
  7.         (if (/= 1 (cdr (assoc 69 (entget mv))))
  8.           (progn
  9.             (setq
  10.               obj (vlax-ename->vla-object mv)
  11.               elist (entget mv)
  12.               )
  13.             (setvar "cvport" (cdr (assoc 69 elist)))
  14.             (setq OldAnnoscale (getvar "cannoscale"))
  15.             (setvar "cannoscale" 0)
  16.             (setvar "cannoscale" oldannoscale)
  17.           )                             ;end progn
  18.         )                               ;end if
  19.       )
  20.     )
  21.     (tolist (ssget "X" '((0 . "VIEWPORT"))))
  22.   )
  23. )

But it fails on the setvar cvport.

Thanks in advance.

Mike

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: Error setting CVPORT
« Reply #1 on: December 26, 2014, 02:28:43 PM »
(posting from iPad) If paperspace is active you need to switch to modelspace before setting cvport to a value that is > 1.
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

mkweaver

  • Bull Frog
  • Posts: 352
Re: Error setting CVPORT
« Reply #2 on: December 26, 2014, 02:39:23 PM »
<face_palm>

that was it.

Thanks.

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: Error setting CVPORT
« Reply #3 on: December 26, 2014, 10:46:22 PM »
You're welcome and be as easy on yourself as you are on others. :)
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst