PDA

View Full Version : Cvport & Viewport



kennet.sjoberg
2004-11-30, 02:52 PM
How can I determine which cvportnumber (getvar "CVPORT") that belongs to an VIEWPORT object ?
Or how can I in a program set mspace in a selected viewport ?

: ) Happy Computing !

kennet

kennet.sjoberg
2004-11-30, 03:07 PM
. . . aaagggh sorry ! Viewport object dxf code ( 69 . n )

: ) Happy Computing !

kennet

pmedina
2004-12-02, 07:41 PM
Dont know if this will help. I use this lisp routine to insert a block in model space at the dimscale, and in paper space at a scale factor of 1. It detects which space is current using the getvar "cvport"


; Description: Inserts block at dimscale, where block name
; is stored as a variable "avblock"
; variable is set in av menu macro when toolbar or drop-down menu is used
; then lisp is run
; Lisp routine name: 'AV'=Aviation 'DS'=DimScale 'I'-Insert
;
; Menu Macro for block insertion: ^C^C(setq avblock "s:/PATH/MYDRAWING");av-ds-ins;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(DEFUN c:av-ds-ins ()
(setvar "cmdecho" 0)
(SETQ VAR1 (GETVAR "osmode"))
(COMMAND "OSMODE" "0")
(if (> (getvar "cvport") 1) (setq Var2 (getvar "dimscale")) (setq Var2 1) )
(setq tx1 (rtos Var2))
(print (strcat "NOTE: Block to be inserted at scale factor of " tx1 ))
(SETQ PT1 (GETPOINT "\n Insertion point:" ))
(COMMAND "_-insert" avblock PT1 Var2 Var2 "0")
(SETVAR "osmode" VAR1)
(setvar "cmdecho" 1)
(print (strcat "Block was inserted using DIMSCALE as scale factor of " tx1 ))
(princ)
)

kennet.sjoberg
2004-12-03, 06:52 AM
Thank You pmedina for trying !

What I was intended to do and now have done, is a program that center a misspaned view in a circular viewport.
The program take a coordinate from modelspace
change to paperspace
investigate the circular viewport
activate modelspace in that viewport
pan the viewport to correct location
deactivate modelspace in that viewport
change back to modelspace

: ) Happy Computing !

kennet