Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Active Paperspace Viewport Again!

10 REPLIES 10
Reply
Message 1 of 11
Anonymous
328 Views, 10 Replies

Active Paperspace Viewport Again!

I posted before about this item but problem
happened.

As some of guys suggested, I set viewport ID to
systemvariable ("cvport") but Autocad crashed by following routine.

This code worked when I run the layout for the
first time but When I switched model space,back to layout again ,and then run
this code,

Acad crashed.


  Any suggestion will be
appreciated.


size=2>                                                                                                      
thanks,


size=2>                                                                                                      
Michi

 

(defun C:AdjustPVport ( / )

 

  ;find display object
  (setq SS
(ssget "X" '( (-4 . "<AND") (0 . "VIEWPORT") (8 . "VPORT") (-3 ("Lug-Plate"))
(-4 . "<NOT") (69 . 1) (-4 . "NOT>") (-4 . "AND>") )))
 
(command "mspace")
  (setq INDEX 0)  
  (repeat 
(sslength ss)

    (setq ENAME (ssname SS
INDEX))
    (setq ELIST (entget ENAME
'("Lug-Plate")))
    (setq VportID (cdr (assoc 69
ELIST)))
    (setvar "cvport" VportID)
   
(setq LugName  (CDR (NTH 1 (CDADR (ASSOC -3 ELIST))))
)
    (setq VPscale  (CDR (NTH 2 (CDADR (ASSOC -3
ELIST)))) )
    (setq CenterX  (CDR (NTH 3 (CDADR (ASSOC
-3 ELIST)))) )
    (setq CenterY  (CDR (NTH 4 (CDADR
(ASSOC -3 ELIST)))) )
    (setq CenterP (list CenterX
CenterY))
    ;activate and adjust scale
   
(command "mspace")
    (command "ucs" "r"
lugname)
    (command "plan" "c")
   
(command "zoom" "scale" (strcat (rtos (/ 1 VPscale) 2 10)
"XP"))
    (command "zoom" "c" CenterP
"")
    (setq INDEX (1+ INDEX))
  )
  (command
"pspace")
  (princ)

10 REPLIES 10
Message 2 of 11
Anonymous
in reply to: Anonymous

I did not look real hard at this code, but what if
no viewports are found?  ss = nil.

 

You should do

 

(if (setq ss .....................)

  (progn

     (command
".mspace")

     (setq INDEX 0)  

 

   );closes progn

);closes if

 

-Jason


face=Arial size=2>



style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">

I posted before about this item but problem
happened.

As some of guys suggested, I set viewport ID to
systemvariable ("cvport") but Autocad crashed by following
routine.

This code worked when I run the layout for the
first time but When I switched model space,back to layout again ,and then run
this code,

Acad crashed.


  Any suggestion will be
appreciated.


size=2>                                                                                                      
thanks,


size=2>                                                                                                      
Michi

 

(defun C:AdjustPVport ( / )

 

  ;find display object
  (setq SS
(ssget "X" '( (-4 . "<AND") (0 . "VIEWPORT") (8 . "VPORT") (-3
("Lug-Plate")) (-4 . "<NOT") (69 . 1) (-4 . "NOT>") (-4 . "AND>")
)))
  (command "mspace")
  (setq INDEX 0)  

  (repeat  (sslength ss)

    (setq ENAME (ssname SS
INDEX))
    (setq ELIST (entget ENAME
'("Lug-Plate")))
    (setq VportID (cdr (assoc 69
ELIST)))
    (setvar "cvport" VportID)
   
(setq LugName  (CDR (NTH 1 (CDADR (ASSOC -3 ELIST))))
)
    (setq VPscale  (CDR (NTH 2 (CDADR (ASSOC -3
ELIST)))) )
    (setq CenterX  (CDR (NTH 3 (CDADR
(ASSOC -3 ELIST)))) )
    (setq CenterY  (CDR (NTH 4
(CDADR (ASSOC -3 ELIST)))) )
    (setq CenterP (list CenterX
CenterY))
    ;activate and adjust
scale
    (command "mspace")
    (command
"ucs" "r" lugname)
    (command "plan"
"c")
    (command "zoom" "scale" (strcat (rtos (/ 1 VPscale)
2 10) "XP"))
    (command "zoom" "c" CenterP
"")
    (setq INDEX (1+ INDEX))
  )
 
(command "pspace")
  (princ)


Message 3 of 11
Anonymous
in reply to: Anonymous

Also Don't forget to localize your
varaibles.

 

-Jason


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">

I posted before about this item but problem
happened.

As some of guys suggested, I set viewport ID to
systemvariable ("cvport") but Autocad crashed by following
routine.

This code worked when I run the layout for the
first time but When I switched model space,back to layout again ,and then run
this code,

Acad crashed.


  Any suggestion will be
appreciated.


size=2>                                                                                                      
thanks,


size=2>                                                                                                      
Michi

 

(defun C:AdjustPVport ( / )

 

  ;find display object
  (setq SS
(ssget "X" '( (-4 . "<AND") (0 . "VIEWPORT") (8 . "VPORT") (-3
("Lug-Plate")) (-4 . "<NOT") (69 . 1) (-4 . "NOT>") (-4 . "AND>")
)))
  (command "mspace")
  (setq INDEX 0)  

  (repeat  (sslength ss)

    (setq ENAME (ssname SS
INDEX))
    (setq ELIST (entget ENAME
'("Lug-Plate")))
    (setq VportID (cdr (assoc 69
ELIST)))
    (setvar "cvport" VportID)
   
(setq LugName  (CDR (NTH 1 (CDADR (ASSOC -3 ELIST))))
)
    (setq VPscale  (CDR (NTH 2 (CDADR (ASSOC -3
ELIST)))) )
    (setq CenterX  (CDR (NTH 3 (CDADR
(ASSOC -3 ELIST)))) )
    (setq CenterY  (CDR (NTH 4
(CDADR (ASSOC -3 ELIST)))) )
    (setq CenterP (list CenterX
CenterY))
    ;activate and adjust
scale
    (command "mspace")
    (command
"ucs" "r" lugname)
    (command "plan"
"c")
    (command "zoom" "scale" (strcat (rtos (/ 1 VPscale)
2 10) "XP"))
    (command "zoom" "c" CenterP
"")
    (setq INDEX (1+ INDEX))
  )
 
(command "pspace")
  (princ)


Message 4 of 11
Anonymous
in reply to: Anonymous

You'd better thrown in some detection and selection filtering for the
current layout...
(setq ctab (getvar "ctab"))
(if (= ctab "Model")
(prompt "\nPlease switch to a paper space layout.")
(if (setq SS (ssget "X" (list '(-4 . " "VPORT")(cons 410 ctab) '(-3 ("Lug-Plate")) '(-4 . " "NOT>") '(-4 . "AND>"))))
(progn
; etc.
)
)
)

--
John Uhden, Cadlantic/formerly CADvantage
--> mailto:juhden@cadlantic.com
--> http://www.cadlantic.com
2 Village Road
Sea Girt, NJ 08750
Tel. 732-974-1711
FAX 732-528-1332

"michi" wrote in message
news:FAFAA35CD8A6DEF6C98193C9B3514876@in.WebX.maYIadrTaRb...
> I posted before about this item but problem happened.
> As some of guys suggested, I set viewport ID to systemvariable ("cvport")
but Autocad crashed by following routine.
> This code worked when I run the layout for the first time but When I
switched model space,back to layout again ,and then run this code,
> Acad crashed.
> Error Messages is "INTERNAL ERROR:!Scandr.cpp@1117.eLockViolation"
> Any suggestion will be appreciated.
>
thanks,
>
Michi
>
> (defun C:AdjustPVport ( / )
>
> ;find display object
> (setq SS (ssget "X" '( (-4 . " ("Lug-Plate")) (-4 . "") (-4 . "AND>") )))
> (command "mspace")
> (setq INDEX 0)
> (repeat (sslength ss)
> (setq ENAME (ssname SS INDEX))
> (setq ELIST (entget ENAME '("Lug-Plate")))
> (setq VportID (cdr (assoc 69 ELIST)))
> (setvar "cvport" VportID)
> (setq LugName (CDR (NTH 1 (CDADR (ASSOC -3 ELIST)))) )
> (setq VPscale (CDR (NTH 2 (CDADR (ASSOC -3 ELIST)))) )
> (setq CenterX (CDR (NTH 3 (CDADR (ASSOC -3 ELIST)))) )
> (setq CenterY (CDR (NTH 4 (CDADR (ASSOC -3 ELIST)))) )
> (setq CenterP (list CenterX CenterY))
> ;activate and adjust scale
> (command "mspace")
> (command "ucs" "r" lugname)
> (command "plan" "c")
> (command "zoom" "scale" (strcat (rtos (/ 1 VPscale) 2 10) "XP"))
> (command "zoom" "c" CenterP "")
> (setq INDEX (1+ INDEX))
> )
> (command "pspace")
> (princ)
> )
>
>
Message 5 of 11
Anonymous
in reply to: Anonymous

Why not just......

(if (= "Model" (getvar "ctab"))
(setvar "tilemode" 0)
etc.....


John Uhden wrote in message
news:7201492989B90EE54CA076068273917F@in.WebX.maYIadrTaRb...
> You'd better thrown in some detection and selection filtering for the
> current layout...
> (setq ctab (getvar "ctab"))
> (if (= ctab "Model")
> (prompt "\nPlease switch to a paper space layout.")
> (if (setq SS (ssget "X" (list '(-4 . " > "VPORT")(cons 410 ctab) '(-3 ("Lug-Plate")) '(-4 . " > "NOT>") '(-4 . "AND>"))))
> (progn
> ; etc.
> )
> )
> )
>
> --
> John Uhden, Cadlantic/formerly CADvantage
> --> mailto:juhden@cadlantic.com
> --> http://www.cadlantic.com
> 2 Village Road
> Sea Girt, NJ 08750
> Tel. 732-974-1711
> FAX 732-528-1332
>
> "michi" wrote in message
> news:FAFAA35CD8A6DEF6C98193C9B3514876@in.WebX.maYIadrTaRb...
> > I posted before about this item but problem happened.
> > As some of guys suggested, I set viewport ID to systemvariable
("cvport")
> but Autocad crashed by following routine.
> > This code worked when I run the layout for the first time but When I
> switched model space,back to layout again ,and then run this code,
> > Acad crashed.
> > Error Messages is "INTERNAL ERROR:!Scandr.cpp@1117.eLockViolation"
> > Any suggestion will be appreciated.
> >
> thanks,
> >
> Michi
> >
> > (defun C:AdjustPVport ( / )
> >
> > ;find display object
> > (setq SS (ssget "X" '( (-4 . " (-3
> ("Lug-Plate")) (-4 . "") (-4 . "AND>") )))
> > (command "mspace")
> > (setq INDEX 0)
> > (repeat (sslength ss)
> > (setq ENAME (ssname SS INDEX))
> > (setq ELIST (entget ENAME '("Lug-Plate")))
> > (setq VportID (cdr (assoc 69 ELIST)))
> > (setvar "cvport" VportID)
> > (setq LugName (CDR (NTH 1 (CDADR (ASSOC -3 ELIST)))) )
> > (setq VPscale (CDR (NTH 2 (CDADR (ASSOC -3 ELIST)))) )
> > (setq CenterX (CDR (NTH 3 (CDADR (ASSOC -3 ELIST)))) )
> > (setq CenterY (CDR (NTH 4 (CDADR (ASSOC -3 ELIST)))) )
> > (setq CenterP (list CenterX CenterY))
> > ;activate and adjust scale
> > (command "mspace")
> > (command "ucs" "r" lugname)
> > (command "plan" "c")
> > (command "zoom" "scale" (strcat (rtos (/ 1 VPscale) 2 10) "XP"))
> > (command "zoom" "c" CenterP "")
> > (setq INDEX (1+ INDEX))
> > )
> > (command "pspace")
> > (princ)
> > )
> >
> >
>
>
Message 6 of 11
Anonymous
in reply to: Anonymous

For that matter, do we know this is A2K+?

(if (= 1 (getvar "tilemode"))
(setvar "tilemode" 0)

-Jason

Jason Piercey wrote in message
news:E69AE34D8A7D176C5FE1833C9ED4964B@in.WebX.maYIadrTaRb...
> Why not just......
>
> (if (= "Model" (getvar "ctab"))
> (setvar "tilemode" 0)
> etc.....
>
>
> John Uhden wrote in message
> news:7201492989B90EE54CA076068273917F@in.WebX.maYIadrTaRb...
> > You'd better thrown in some detection and selection filtering for the
> > current layout...
> > (setq ctab (getvar "ctab"))
> > (if (= ctab "Model")
> > (prompt "\nPlease switch to a paper space layout.")
> > (if (setq SS (ssget "X" (list '(-4 . " > > "VPORT")(cons 410 ctab) '(-3 ("Lug-Plate")) '(-4 . " .
> > "NOT>") '(-4 . "AND>"))))
> > (progn
> > ; etc.
> > )
> > )
> > )
> >
> > --
> > John Uhden, Cadlantic/formerly CADvantage
> > --> mailto:juhden@cadlantic.com
> > --> http://www.cadlantic.com
> > 2 Village Road
> > Sea Girt, NJ 08750
> > Tel. 732-974-1711
> > FAX 732-528-1332
> >
> > "michi" wrote in message
> > news:FAFAA35CD8A6DEF6C98193C9B3514876@in.WebX.maYIadrTaRb...
> > > I posted before about this item but problem happened.
> > > As some of guys suggested, I set viewport ID to systemvariable
> ("cvport")
> > but Autocad crashed by following routine.
> > > This code worked when I run the layout for the first time but When I
> > switched model space,back to layout again ,and then run this code,
> > > Acad crashed.
> > > Error Messages is "INTERNAL ERROR:!Scandr.cpp@1117.eLockViolation"
> > > Any suggestion will be appreciated.
> > >
> > thanks,
> > >
> > Michi
> > >
> > > (defun C:AdjustPVport ( / )
> > >
> > > ;find display object
> > > (setq SS (ssget "X" '( (-4 . " > (-3
> > ("Lug-Plate")) (-4 . "") (-4 . "AND>") )))
> > > (command "mspace")
> > > (setq INDEX 0)
> > > (repeat (sslength ss)
> > > (setq ENAME (ssname SS INDEX))
> > > (setq ELIST (entget ENAME '("Lug-Plate")))
> > > (setq VportID (cdr (assoc 69 ELIST)))
> > > (setvar "cvport" VportID)
> > > (setq LugName (CDR (NTH 1 (CDADR (ASSOC -3 ELIST)))) )
> > > (setq VPscale (CDR (NTH 2 (CDADR (ASSOC -3 ELIST)))) )
> > > (setq CenterX (CDR (NTH 3 (CDADR (ASSOC -3 ELIST)))) )
> > > (setq CenterY (CDR (NTH 4 (CDADR (ASSOC -3 ELIST)))) )
> > > (setq CenterP (list CenterX CenterY))
> > > ;activate and adjust scale
> > > (command "mspace")
> > > (command "ucs" "r" lugname)
> > > (command "plan" "c")
> > > (command "zoom" "scale" (strcat (rtos (/ 1 VPscale) 2 10) "XP"))
> > > (command "zoom" "c" CenterP "")
> > > (setq INDEX (1+ INDEX))
> > > )
> > > (command "pspace")
> > > (princ)
> > > )
> > >
> > >
> >
> >
>
>
Message 7 of 11
Anonymous
in reply to: Anonymous

I dunno, maybe he doesn't want to regen.

--
John Uhden, Cadlantic/formerly CADvantage
--> mailto:juhden@cadlantic.com
--> http://www.cadlantic.com
2 Village Road
Sea Girt, NJ 08750
Tel. 732-974-1711
FAX 732-528-1332

"Jason Piercey" wrote in message
news:E69AE34D8A7D176C5FE1833C9ED4964B@in.WebX.maYIadrTaRb...
> Why not just......
>
> (if (= "Model" (getvar "ctab"))
> (setvar "tilemode" 0)
> etc.....
>
>
> John Uhden wrote in message
> news:7201492989B90EE54CA076068273917F@in.WebX.maYIadrTaRb...
> > You'd better thrown in some detection and selection filtering for the
> > current layout...
> > (setq ctab (getvar "ctab"))
> > (if (= ctab "Model")
> > (prompt "\nPlease switch to a paper space layout.")
> > (if (setq SS (ssget "X" (list '(-4 . " > > "VPORT")(cons 410 ctab) '(-3 ("Lug-Plate")) '(-4 . " .
> > "NOT>") '(-4 . "AND>"))))
> > (progn
> > ; etc.
> > )
> > )
> > )
> >
> > --
> > John Uhden, Cadlantic/formerly CADvantage
> > --> mailto:juhden@cadlantic.com
> > --> http://www.cadlantic.com
> > 2 Village Road
> > Sea Girt, NJ 08750
> > Tel. 732-974-1711
> > FAX 732-528-1332
> >
> > "michi" wrote in message
> > news:FAFAA35CD8A6DEF6C98193C9B3514876@in.WebX.maYIadrTaRb...
> > > I posted before about this item but problem happened.
> > > As some of guys suggested, I set viewport ID to systemvariable
> ("cvport")
> > but Autocad crashed by following routine.
> > > This code worked when I run the layout for the first time but When I
> > switched model space,back to layout again ,and then run this code,
> > > Acad crashed.
> > > Error Messages is "INTERNAL ERROR:!Scandr.cpp@1117.eLockViolation"
> > > Any suggestion will be appreciated.
> > >
> > thanks,
> > >
> > Michi
> > >
> > > (defun C:AdjustPVport ( / )
> > >
> > > ;find display object
> > > (setq SS (ssget "X" '( (-4 . " > (-3
> > ("Lug-Plate")) (-4 . "") (-4 . "AND>") )))
> > > (command "mspace")
> > > (setq INDEX 0)
> > > (repeat (sslength ss)
> > > (setq ENAME (ssname SS INDEX))
> > > (setq ELIST (entget ENAME '("Lug-Plate")))
> > > (setq VportID (cdr (assoc 69 ELIST)))
> > > (setvar "cvport" VportID)
> > > (setq LugName (CDR (NTH 1 (CDADR (ASSOC -3 ELIST)))) )
> > > (setq VPscale (CDR (NTH 2 (CDADR (ASSOC -3 ELIST)))) )
> > > (setq CenterX (CDR (NTH 3 (CDADR (ASSOC -3 ELIST)))) )
> > > (setq CenterY (CDR (NTH 4 (CDADR (ASSOC -3 ELIST)))) )
> > > (setq CenterP (list CenterX CenterY))
> > > ;activate and adjust scale
> > > (command "mspace")
> > > (command "ucs" "r" lugname)
> > > (command "plan" "c")
> > > (command "zoom" "scale" (strcat (rtos (/ 1 VPscale) 2 10) "XP"))
> > > (command "zoom" "c" CenterP "")
> > > (setq INDEX (1+ INDEX))
> > > )
> > > (command "pspace")
> > > (princ)
> > > )
> > >
> > >
> >
> >
>
>
Message 8 of 11
Anonymous
in reply to: Anonymous

I was just going by his words "When I switched model space,back to layout
again ..."

--
John Uhden, Cadlantic/formerly CADvantage
--> mailto:juhden@cadlantic.com
--> http://www.cadlantic.com
2 Village Road
Sea Girt, NJ 08750
Tel. 732-974-1711
FAX 732-528-1332

"Jason Piercey" wrote in message
news:AA1CD30E4C288AB025C0E5324B2325BF@in.WebX.maYIadrTaRb...
> For that matter, do we know this is A2K+?
>
> (if (= 1 (getvar "tilemode"))
> (setvar "tilemode" 0)
>
> -Jason
>
> Jason Piercey wrote in message
> news:E69AE34D8A7D176C5FE1833C9ED4964B@in.WebX.maYIadrTaRb...
> > Why not just......
> >
> > (if (= "Model" (getvar "ctab"))
> > (setvar "tilemode" 0)
> > etc.....
> >
> >
> > John Uhden wrote in message
> > news:7201492989B90EE54CA076068273917F@in.WebX.maYIadrTaRb...
> > > You'd better thrown in some detection and selection filtering for the
> > > current layout...
> > > (setq ctab (getvar "ctab"))
> > > (if (= ctab "Model")
> > > (prompt "\nPlease switch to a paper space layout.")
> > > (if (setq SS (ssget "X" (list '(-4 . " .
> > > "VPORT")(cons 410 ctab) '(-3 ("Lug-Plate")) '(-4 . " '(-4
> .
> > > "NOT>") '(-4 . "AND>"))))
> > > (progn
> > > ; etc.
> > > )
> > > )
> > > )
> > >
> > > --
> > > John Uhden, Cadlantic/formerly CADvantage
> > > --> mailto:juhden@cadlantic.com
> > > --> http://www.cadlantic.com
> > > 2 Village Road
> > > Sea Girt, NJ 08750
> > > Tel. 732-974-1711
> > > FAX 732-528-1332
> > >
> > > "michi" wrote in message
> > > news:FAFAA35CD8A6DEF6C98193C9B3514876@in.WebX.maYIadrTaRb...
> > > > I posted before about this item but problem happened.
> > > > As some of guys suggested, I set viewport ID to systemvariable
> > ("cvport")
> > > but Autocad crashed by following routine.
> > > > This code worked when I run the layout for the first time but When I
> > > switched model space,back to layout again ,and then run this code,
> > > > Acad crashed.
> > > > Error Messages is "INTERNAL ERROR:!Scandr.cpp@1117.eLockViolation"
> > > > Any suggestion will be appreciated.
> > > >
> > > thanks,
> > > >
> > > Michi
> > > >
> > > > (defun C:AdjustPVport ( / )
> > > >
> > > > ;find display object
> > > > (setq SS (ssget "X" '( (-4 . " "VPORT")
> > (-3
> > > ("Lug-Plate")) (-4 . "") (-4 . "AND>") )))
> > > > (command "mspace")
> > > > (setq INDEX 0)
> > > > (repeat (sslength ss)
> > > > (setq ENAME (ssname SS INDEX))
> > > > (setq ELIST (entget ENAME '("Lug-Plate")))
> > > > (setq VportID (cdr (assoc 69 ELIST)))
> > > > (setvar "cvport" VportID)
> > > > (setq LugName (CDR (NTH 1 (CDADR (ASSOC -3 ELIST)))) )
> > > > (setq VPscale (CDR (NTH 2 (CDADR (ASSOC -3 ELIST)))) )
> > > > (setq CenterX (CDR (NTH 3 (CDADR (ASSOC -3 ELIST)))) )
> > > > (setq CenterY (CDR (NTH 4 (CDADR (ASSOC -3 ELIST)))) )
> > > > (setq CenterP (list CenterX CenterY))
> > > > ;activate and adjust scale
> > > > (command "mspace")
> > > > (command "ucs" "r" lugname)
> > > > (command "plan" "c")
> > > > (command "zoom" "scale" (strcat (rtos (/ 1 VPscale) 2 10) "XP"))
> > > > (command "zoom" "c" CenterP "")
> > > > (setq INDEX (1+ INDEX))
> > > > )
> > > > (command "pspace")
> > > > (princ)
> > > > )
> > > >
> > > >
> > >
> > >
> >
> >
>
>
Message 9 of 11
Anonymous
in reply to: Anonymous

Thank you for your help. I am using A2K.
I found one solution.
When regenall command is manually executed and then run the routine, it
works.
(Interactively like adding (command "regenall") in front of the routine,
again it crashed.)
I don't know the reason but any way I found temporary cure.

thanks,

Michi


John Uhden wrote in message
news:2373885FEDCDF20E0A2225AEB4EF58AF@in.WebX.maYIadrTaRb...
> I dunno, maybe he doesn't want to regen.
>
> --
> John Uhden, Cadlantic/formerly CADvantage
> --> mailto:juhden@cadlantic.com
> --> http://www.cadlantic.com
> 2 Village Road
> Sea Girt, NJ 08750
> Tel. 732-974-1711
> FAX 732-528-1332
>
> "Jason Piercey" wrote in message
> news:E69AE34D8A7D176C5FE1833C9ED4964B@in.WebX.maYIadrTaRb...
> > Why not just......
> >
> > (if (= "Model" (getvar "ctab"))
> > (setvar "tilemode" 0)
> > etc.....
> >
> >
> > John Uhden wrote in message
> > news:7201492989B90EE54CA076068273917F@in.WebX.maYIadrTaRb...
> > > You'd better thrown in some detection and selection filtering for the
> > > current layout...
> > > (setq ctab (getvar "ctab"))
> > > (if (= ctab "Model")
> > > (prompt "\nPlease switch to a paper space layout.")
> > > (if (setq SS (ssget "X" (list '(-4 . " .
> > > "VPORT")(cons 410 ctab) '(-3 ("Lug-Plate")) '(-4 . " '(-4
> .
> > > "NOT>") '(-4 . "AND>"))))
> > > (progn
> > > ; etc.
> > > )
> > > )
> > > )
> > >
> > > --
> > > John Uhden, Cadlantic/formerly CADvantage
> > > --> mailto:juhden@cadlantic.com
> > > --> http://www.cadlantic.com
> > > 2 Village Road
> > > Sea Girt, NJ 08750
> > > Tel. 732-974-1711
> > > FAX 732-528-1332
> > >
> > > "michi" wrote in message
> > > news:FAFAA35CD8A6DEF6C98193C9B3514876@in.WebX.maYIadrTaRb...
> > > > I posted before about this item but problem happened.
> > > > As some of guys suggested, I set viewport ID to systemvariable
> > ("cvport")
> > > but Autocad crashed by following routine.
> > > > This code worked when I run the layout for the first time but When I
> > > switched model space,back to layout again ,and then run this code,
> > > > Acad crashed.
> > > > Error Messages is "INTERNAL ERROR:!Scandr.cpp@1117.eLockViolation"
> > > > Any suggestion will be appreciated.
> > > >
> > > thanks,
> > > >
> > > Michi
> > > >
> > > > (defun C:AdjustPVport ( / )
> > > >
> > > > ;find display object
> > > > (setq SS (ssget "X" '( (-4 . " "VPORT")
> > (-3
> > > ("Lug-Plate")) (-4 . "") (-4 . "AND>") )))
> > > > (command "mspace")
> > > > (setq INDEX 0)
> > > > (repeat (sslength ss)
> > > > (setq ENAME (ssname SS INDEX))
> > > > (setq ELIST (entget ENAME '("Lug-Plate")))
> > > > (setq VportID (cdr (assoc 69 ELIST)))
> > > > (setvar "cvport" VportID)
> > > > (setq LugName (CDR (NTH 1 (CDADR (ASSOC -3 ELIST)))) )
> > > > (setq VPscale (CDR (NTH 2 (CDADR (ASSOC -3 ELIST)))) )
> > > > (setq CenterX (CDR (NTH 3 (CDADR (ASSOC -3 ELIST)))) )
> > > > (setq CenterY (CDR (NTH 4 (CDADR (ASSOC -3 ELIST)))) )
> > > > (setq CenterP (list CenterX CenterY))
> > > > ;activate and adjust scale
> > > > (command "mspace")
> > > > (command "ucs" "r" lugname)
> > > > (command "plan" "c")
> > > > (command "zoom" "scale" (strcat (rtos (/ 1 VPscale) 2 10) "XP"))
> > > > (command "zoom" "c" CenterP "")
> > > > (setq INDEX (1+ INDEX))
> > > > )
> > > > (command "pspace")
> > > > (princ)
> > > > )
> > > >
> > > >
> > >
> > >
> >
> >
>
>
Message 10 of 11
Anonymous
in reply to: Anonymous

Michi-

Do a search for "elock violation" within this group. There are some threads
that will give you info-

Look for a thread on this NG titled "Elock Violation Advice". It's from
around the middle of February, and one titled "Combining an application with
reactors and calling another without them" from the 17th of April.

Good Luck

Joe
Message 11 of 11
Anonymous
in reply to: Anonymous

Thank you for information, Joe!
Michi

Joseph Charpentier wrote in message
news:9B6FE89DD875F9B2499C208714465723@in.WebX.maYIadrTaRb...
> Michi-
>
> Do a search for "elock violation" within this group. There are some
threads
> that will give you info-
>
> Look for a thread on this NG titled "Elock Violation Advice". It's from
> around the middle of February, and one titled "Combining an application
with
> reactors and calling another without them" from the 17th of April.
>
> Good Luck
>
> Joe
>
>

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost