hey guys i would like to modify this routine so it puts the box created on defpoints layer not the current layer. how do i modify this don't see anything about layers here but i'm not as sharp as you guys so....
;Tip1687: VPLIM.LSP Pspace Limits in Mspace (c)2001, Murray Clack
;VPLIM.lsp draws the limits of a Paperspace Viewport Boundary in MODELSPACE
;VP - Get ViewPort object
;HT - Get Outside HeighT of Viewport
;WD - Get Oustide WiDth of Viewport
;VN - Get Viewport Number
;CTR - Get CenTeR of Viewport
;CTRX - Caluculate X of Viewport CenTeR
;CTRY - Caluculate Y of Viewport CenTeR
;VS - Get View Size of viewport
;XP - Calculate XP factor of viewport
;IW - Calculate Width of viewport
;BL - Calculate Bottom Left corner of viewport
;BR - Calculate Bottom Right corner of viewport
;TR - Calculate Top Right corner of viewport
;TL - Calculate Top Left corner of viewport
;PW - Save PlineWid
;OS - Save OSmode
;start function and define variables
(defun
C:VPL (/ VP HT WD VN CTR CTRX CTRY VS XP IW BL BR TR TL PW OS
)
;turn off command echoing
(setvar "cmdecho" 0)
;enter pspace
(command ".pspace")
;select viewport boundary
(setq VP
(entget
(car (entsel
"\nSelect Viewport to Draw Boundary
in "
) ;_ end of entsel
) ;_ end of car
) ;_ end of entget
) ;_ end of setq
;Get Viewport height with
(setq HT (cdr (assoc 41 VP)))
;Get Viewport width with
(setq WD (cdr (assoc 40 VP)))
;Get Viewport Number
(setq VN (cdr (assoc 69 VP)))
;enter mspace
(command ".mspace")
;set correct viewport
(setvar "cvport" VN)
;set UCS to View
(command ".ucs" "v")
;Get VIEWCTR store as CTR
(setq CTR (getvar "viewctr"))
;Get X of CTR
(setq CTRX (car CTR))
;Get Y of CTR
(setq CTRY (cadr CTR))
;Get inside Viewport height
(setq VS (getvar "viewsize"))
;Get XP Factor with HeighT / View Size
(setq XP (/ HT VS))
;Get inside width of Viewport by
(setq IW (* (/ VS HT) WD))
;Find four corners of Viewport
(setq BL (list (- CTRX (/ IW 2)) (- CTRY (/ VS 2))))
(setq BR (list (+ CTRX (/ IW 2)) (- CTRY (/ VS 2))))
(setq TR (list (+ CTRX (/ IW 2)) (+ CTRY (/ VS 2))))
(setq TL (list (- CTRX (/ IW 2)) (+ CTRY (/ VS 2))))
;Save current pline width
(setq PW (getvar "plinewid"))
;Set Pline width to zero
(setvar "plinewid" 0)
;Save current osmode
(setq OS (getvar "osmode"))
;Draw pline inside border
(command ".pline" BL BR TR TL "c")
;Restore pline width back
(setvar "plinewid" PW)
;Restore UCS back
(command ".ucs" "p")
;Restore osmode
(setvar "osmode" OS)
;Clean up command prompt
(princ)
;Go Back To Papserspace
(command ".pspace")
) ;The End!