making and setting layer in simple program

making and setting layer in simple program

Anonymous
Not applicable
150 Views
2 Replies
Message 1 of 3

making and setting layer in simple program

Anonymous
Not applicable
Hi,

I was wondering if anyone knows why this little program won't change to
the X-VIEW-PORT layer upon executing. It creates the layer but doesn't
change to the layer. I want a viewport in this layer. It just seems to
bypass that part. I have a similar program for Xrefing a drawing and it
works fine (see last paragraph)..

; Make a viewport in X-VIEW-PORT (does not work)
;
(defun c:kk ()
(setq curlay (getvar "clayer"))
(command ".LAYER" "M" "X-VIEW-PORT" "")
(command ".LAYER" "S" "X-VIEW-PORT" "")
(command ".MVIEW")
(setvar "clayer" curlay)
)

; Xref using overlay (works)
;
(defun c:rx ()
(setq curlay (getvar "clayer"))
(command ".LAYER" "M" "X-REFR-DWGS" "")
(command ".XREF" "O" "~" "0,0" "1" "1" "0")
(setvar "clayer" curlay)
)

Any responses would be appreciated.

JJ
0 Likes
151 Views
2 Replies
Replies (2)
Message 2 of 3

Anonymous
Not applicable
You are not waiting for the MView command to complete before resetting the
current layer.

CmdActive


--
R. Robert Bell, MCSE
www.AcadX.com


"JJ" wrote in message
news:98927672040BBFEDA2EB8D37E518712D@in.WebX.maYIadrTaRb...
| Hi,
|
| I was wondering if anyone knows why this little program won't change to
| the X-VIEW-PORT layer upon executing. It creates the layer but doesn't
| change to the layer. I want a viewport in this layer. It just seems to
| bypass that part. I have a similar program for Xrefing a drawing and it
| works fine (see last paragraph)..
|
| ; Make a viewport in X-VIEW-PORT (does not work)
| ;
| (defun c:kk ()
| (setq curlay (getvar "clayer"))
| (command ".LAYER" "M" "X-VIEW-PORT" "")
| (command ".LAYER" "S" "X-VIEW-PORT" "")
| (command ".MVIEW")
| (setvar "clayer" curlay)
| )
|
| ; Xref using overlay (works)
| ;
| (defun c:rx ()
| (setq curlay (getvar "clayer"))
| (command ".LAYER" "M" "X-REFR-DWGS" "")
| (command ".XREF" "O" "~" "0,0" "1" "1" "0")
| (setvar "clayer" curlay)
| )
|
| Any responses would be appreciated.
|
| JJ
|
0 Likes
Message 3 of 3

Anonymous
Not applicable
Thanks.

R. Robert Bell wrote:

>You are not waiting for the MView command to complete before resetting the
>current layer.
>
>CmdActive
>
>
>
>
0 Likes