Reactor question

Reactor question

Anonymous
Not applicable
338 Views
14 Replies
Message 1 of 15

Reactor question

Anonymous
Not applicable
Attached is a small jpg of an alert I get when I close a drawing. Would I
get this if a reactor is firing or is there something wrong?

Dan Elkins
0 Likes
339 Views
14 Replies
Replies (14)
Message 2 of 15

Anonymous
Not applicable
Dan,

I have received this same message as the result of a mistake in AutoLISP
programming in which I tried to close the drawing without answering a
previous prompt.

As I recall, it was difficult to get out of the situation as Esc would not
cancel it. Can't remember what I did, though.

Hope this will give you some ideas what to check.
--
Dave D

Dan Elkins wrote in article
<877prf$ngh31@adesknews2.autodesk.com>...
> Attached is a small jpg of an alert I get when I close a drawing. Would
I
> get this if a reactor is firing or is there something wrong?
>
> Dan Elkins
>
>
>
0 Likes
Message 3 of 15

Anonymous
Not applicable
I am trying to attach reactors to a copied blockref object which has
reactors attached. First, why don't the reactors go with the copied object
in the first place and second, why can't you convert the ename of the newly
created object to a vla-object? I get the following error values when the
subr below is called:

[0.61] (VL-BT)
[1.57] (*ERROR* "Automation Error. Description was not provided.")
[2.52] (_call-err-hook # "Automation Error.
Description
was not provided.")
[3.46] (sys-error "Automation Error. Description was not provided.")
:ERROR-BREAK.41 nil
[4.38] (intelligent-invoke #
"ObjectIdToObject" 1 24831232)
[5.30] (# #
00b91294> "ObjectIdToObject" 24831232)
[6.24] (vla-ObjectIDToObject # 24831232)
[7.18] (vlax-ename->vla-object )
[8.13] (BDR:REACTION-COPIED #
# ())
:CALLBACK-ENTRY.6 (:CALLBACK-ENTRY)
:REACTOR-CALLBACK.3 :REACTOR-CALLBACK

As you can see this is my first reactor attempt. Enlighten me, friends.

;BDR:REACTION-COPIED________________________________________________________
_____________________________________________________
;Reactor callback to attach reactors to a copied border

(defun bdr:reaction-copied (notifier-object reactor-object parameter-list /
blockname blkref)

(setq
blockname (vlr-data reactor-object)
blkref (vlax-ename->vla-object (car parameter-list)) ;THE NEWLY CREATED
OBJECT
)
(vlr-pers
(vlr-object-reactor
(list blkref)
blockname
'((:vlr-erased . bdr:reaction-erased)(:vlr-copied . bdr:reaction-copied))
)
)
)

--

Cliff Middleton, Tool Engineering Manager
General Broach Company
ph 517 458 7555 fax 517 458 6821
ICQ 31386833

Broaching...learn it, live it, love it.
www.generalbroach.com
0 Likes
Message 4 of 15

Anonymous
Not applicable
What release of AutoCAD are you using?

Cliff Middleton wrote:
>
> I am trying to attach reactors to a copied blockref object which has
> reactors attached. First, why don't the reactors go with the copied object
> in the first place and second, why can't you convert the ename of the newly
> created object to a vla-object? I get the following error values when the
> subr below is called:
>
> [0.61] (VL-BT)
> [1.57] (*ERROR* "Automation Error. Description was not provided.")
> [2.52] (_call-err-hook # "Automation Error.
> Description
> was not provided.")
> [3.46] (sys-error "Automation Error. Description was not provided.")
> :ERROR-BREAK.41 nil
> [4.38] (intelligent-invoke #
> "ObjectIdToObject" 1 24831232)
> [5.30] (# #
> 00b91294> "ObjectIdToObject" 24831232)
> [6.24] (vla-ObjectIDToObject # 24831232)
> [7.18] (vlax-ename->vla-object )
> [8.13] (BDR:REACTION-COPIED #
> # ())
> :CALLBACK-ENTRY.6 (:CALLBACK-ENTRY)
> :REACTOR-CALLBACK.3 :REACTOR-CALLBACK
>
> As you can see this is my first reactor attempt. Enlighten me, friends.
>
> ;BDR:REACTION-COPIED________________________________________________________
> _____________________________________________________
> ;Reactor callback to attach reactors to a copied border
>
> (defun bdr:reaction-copied (notifier-object reactor-object parameter-list /
> blockname blkref)
>
> (setq
> blockname (vlr-data reactor-object)
> blkref (vlax-ename->vla-object (car parameter-list)) ;THE NEWLY CREATED
> OBJECT
> )
> (vlr-pers
> (vlr-object-reactor
> (list blkref)
> blockname
> '((:vlr-erased . bdr:reaction-erased)(:vlr-copied . bdr:reaction-copied))
> )
> )
> )
>
> --
>
> Cliff Middleton, Tool Engineering Manager
> General Broach Company
> ph 517 458 7555 fax 517 458 6821
> ICQ 31386833
>
> Broaching...learn it, live it, love it.
> www.generalbroach.com

--

Checkout the AcadX(tm) ActiveX Extension Library at:

http://www.caddzone.com/acadx/acadx.htm

/*********************************************************/
/* Tony Tanzillo Design Automation Consulting */
/* Programming & Customization for AutoCAD & Compatibles */
/* ----------------------------------------------------- */
/* tony.tanzillo@worldnet.att.net */
/* http://www.caddzone.com */
/*********************************************************/
0 Likes
Message 5 of 15

Anonymous
Not applicable
R15

Tony Tanzillo wrote in message
news:39872E9A.9CD8E07B@worldnet.att.net...
| What release of AutoCAD are you using?
|
| Cliff Middleton wrote:
| >
| > I am trying to attach reactors to a copied blockref object which has
| > reactors attached. First, why don't the reactors go with the copied
object
| > in the first place and second, why can't you convert the ename of the
newly
| > created object to a vla-object? I get the following error values when
the
| > subr below is called:
| >
| > [0.61] (VL-BT)
| > [1.57] (*ERROR* "Automation Error. Description was not provided.")
| > [2.52] (_call-err-hook # "Automation Error.
| > Description
| > was not provided.")
| > [3.46] (sys-error "Automation Error. Description was not provided.")
| > :ERROR-BREAK.41 nil
| > [4.38] (intelligent-invoke #
| > "ObjectIdToObject" 1 24831232)
| > [5.30] (# #
| > 00b91294> "ObjectIdToObject" 24831232)
| > [6.24] (vla-ObjectIDToObject #
24831232)
| > [7.18] (vlax-ename->vla-object )
| > [8.13] (BDR:REACTION-COPIED #
| > # ())
| > :CALLBACK-ENTRY.6 (:CALLBACK-ENTRY)
| > :REACTOR-CALLBACK.3 :REACTOR-CALLBACK
| >
| > As you can see this is my first reactor attempt. Enlighten me, friends.
| >
| >
;BDR:REACTION-COPIED________________________________________________________
| > _____________________________________________________
| > ;Reactor callback to attach reactors to a copied border
| >
| > (defun bdr:reaction-copied (notifier-object reactor-object
parameter-list /
| > blockname blkref)
| >
| > (setq
| > blockname (vlr-data reactor-object)
| > blkref (vlax-ename->vla-object (car parameter-list)) ;THE NEWLY
CREATED
| > OBJECT
| > )
| > (vlr-pers
| > (vlr-object-reactor
| > (list blkref)
| > blockname
| > '((:vlr-erased . bdr:reaction-erased)(:vlr-copied .
bdr:reaction-copied))
| > )
| > )
| > )
| >
| > --
| >
| > Cliff Middleton, Tool Engineering Manager
| > General Broach Company
| > ph 517 458 7555 fax 517 458 6821
| > ICQ 31386833
| >
| > Broaching...learn it, live it, love it.
| > www.generalbroach.com
|
| --
|
| Checkout the AcadX(tm) ActiveX Extension Library at:
|
| http://www.caddzone.com/acadx/acadx.htm
|
| /*********************************************************/
| /* Tony Tanzillo Design Automation Consulting */
| /* Programming & Customization for AutoCAD & Compatibles */
| /* ----------------------------------------------------- */
| /* tony.tanzillo@worldnet.att.net */
| /* http://www.caddzone.com */
| /*********************************************************/
0 Likes
Message 6 of 15

Anonymous
Not applicable
You cannot always access objects through ActiveX during some
reactor notifications. In this case, AutoCAD must create
a ActiveX wrapper for the new object before it can be accessed
through ActiveX, and probably can't do that until after the
copy notification is completed.

You should collect the enames in list, store themin a global,
and then in some later notification (like command-ended) act
on the objects.

Cliff Middleton wrote:
>
> R15
>
> Tony Tanzillo wrote in message
> news:39872E9A.9CD8E07B@worldnet.att.net...
> | What release of AutoCAD are you using?
> |
> | Cliff Middleton wrote:
> | >
> | > I am trying to attach reactors to a copied blockref object which has
> | > reactors attached. First, why don't the reactors go with the copied
> object
> | > in the first place and second, why can't you convert the ename of the
> newly
> | > created object to a vla-object? I get the following error values when
> the
> | > subr below is called:
> | >
> | > [0.61] (VL-BT)
> | > [1.57] (*ERROR* "Automation Error. Description was not provided.")
> | > [2.52] (_call-err-hook # "Automation Error.
> | > Description
> | > was not provided.")
> | > [3.46] (sys-error "Automation Error. Description was not provided.")
> | > :ERROR-BREAK.41 nil
> | > [4.38] (intelligent-invoke #
> | > "ObjectIdToObject" 1 24831232)
> | > [5.30] (# #
> | > 00b91294> "ObjectIdToObject" 24831232)
> | > [6.24] (vla-ObjectIDToObject #
> 24831232)
> | > [7.18] (vlax-ename->vla-object )
> | > [8.13] (BDR:REACTION-COPIED #
> | > # ())
> | > :CALLBACK-ENTRY.6 (:CALLBACK-ENTRY)
> | > :REACTOR-CALLBACK.3 :REACTOR-CALLBACK
> | >
> | > As you can see this is my first reactor attempt. Enlighten me, friends.
> | >
> | >
> ;BDR:REACTION-COPIED________________________________________________________
> | > _____________________________________________________
> | > ;Reactor callback to attach reactors to a copied border
> | >
> | > (defun bdr:reaction-copied (notifier-object reactor-object
> parameter-list /
> | > blockname blkref)
> | >
> | > (setq
> | > blockname (vlr-data reactor-object)
> | > blkref (vlax-ename->vla-object (car parameter-list)) ;THE NEWLY
> CREATED
> | > OBJECT
> | > )
> | > (vlr-pers
> | > (vlr-object-reactor
> | > (list blkref)
> | > blockname
> | > '((:vlr-erased . bdr:reaction-erased)(:vlr-copied .
> bdr:reaction-copied))
> | > )
> | > )
> | > )
> | >
> | > --
> | >
> | > Cliff Middleton, Tool Engineering Manager
> | > General Broach Company
> | > ph 517 458 7555 fax 517 458 6821
> | > ICQ 31386833
> | >
> | > Broaching...learn it, live it, love it.
> | > www.generalbroach.com
> |
> | --
> |
> | Checkout the AcadX(tm) ActiveX Extension Library at:
> |
> | http://www.caddzone.com/acadx/acadx.htm
> |
> | /*********************************************************/
> | /* Tony Tanzillo Design Automation Consulting */
> | /* Programming & Customization for AutoCAD & Compatibles */
> | /* ----------------------------------------------------- */
> | /* tony.tanzillo@worldnet.att.net */
> | /* http://www.caddzone.com */
> | /*********************************************************/

--

Checkout the AcadX(tm) ActiveX Extension Library at:

http://www.caddzone.com/acadx/acadx.htm

/*********************************************************/
/* Tony Tanzillo Design Automation Consulting */
/* Programming & Customization for AutoCAD & Compatibles */
/* ----------------------------------------------------- */
/* tony.tanzillo@worldnet.att.net */
/* http://www.caddzone.com */
/*********************************************************/
0 Likes
Message 7 of 15

Anonymous
Not applicable
Would I have to create a command-reator during the callback from the
object-reator to fire another callback on command-ended notification?

Tony Tanzillo wrote in message
news:398ADD53.80192011@worldnet.att.net...
| You cannot always access objects through ActiveX during some
| reactor notifications. In this case, AutoCAD must create
| a ActiveX wrapper for the new object before it can be accessed
| through ActiveX, and probably can't do that until after the
| copy notification is completed.
|
| You should collect the enames in list, store themin a global,
| and then in some later notification (like command-ended) act
| on the objects.
|
| Cliff Middleton wrote:
| >
| > R15
| >
| > Tony Tanzillo wrote in message
| > news:39872E9A.9CD8E07B@worldnet.att.net...
| > | What release of AutoCAD are you using?
| > |
| > | Cliff Middleton wrote:
| > | >
| > | > I am trying to attach reactors to a copied blockref object which has
| > | > reactors attached. First, why don't the reactors go with the copied
| > object
| > | > in the first place and second, why can't you convert the ename of
the
| > newly
| > | > created object to a vla-object? I get the following error values
when
| > the
| > | > subr below is called:
| > | >
| > | > [0.61] (VL-BT)
| > | > [1.57] (*ERROR* "Automation Error. Description was not provided.")
| > | > [2.52] (_call-err-hook # "Automation Error.
| > | > Description
| > | > was not provided.")
| > | > [3.46] (sys-error "Automation Error. Description was not provided.")
| > | > :ERROR-BREAK.41 nil
| > | > [4.38] (intelligent-invoke #
| > | > "ObjectIdToObject" 1 24831232)
| > | > [5.30] (# #
IAcadDocument
| > | > 00b91294> "ObjectIdToObject" 24831232)
| > | > [6.24] (vla-ObjectIDToObject #
| > 24831232)
| > | > [7.18] (vlax-ename->vla-object )
| > | > [8.13] (BDR:REACTION-COPIED #
04024074>
| > | > # ())
| > | > :CALLBACK-ENTRY.6 (:CALLBACK-ENTRY)
| > | > :REACTOR-CALLBACK.3 :REACTOR-CALLBACK
| > | >
| > | > As you can see this is my first reactor attempt. Enlighten me,
friends.
| > | >
| > | >
| >
;BDR:REACTION-COPIED________________________________________________________
| > | > _____________________________________________________
| > | > ;Reactor callback to attach reactors to a copied border
| > | >
| > | > (defun bdr:reaction-copied (notifier-object reactor-object
| > parameter-list /
| > | > blockname blkref)
| > | >
| > | > (setq
| > | > blockname (vlr-data reactor-object)
| > | > blkref (vlax-ename->vla-object (car parameter-list)) ;THE NEWLY
| > CREATED
| > | > OBJECT
| > | > )
| > | > (vlr-pers
| > | > (vlr-object-reactor
| > | > (list blkref)
| > | > blockname
| > | > '((:vlr-erased . bdr:reaction-erased)(:vlr-copied .
| > bdr:reaction-copied))
| > | > )
| > | > )
| > | > )
| > | >
| > | > --
| > | >
| > | > Cliff Middleton, Tool Engineering Manager
| > | > General Broach Company
| > | > ph 517 458 7555 fax 517 458 6821
| > | > ICQ 31386833
| > | >
| > | > Broaching...learn it, live it, love it.
| > | > www.generalbroach.com
| > |
| > | --
| > |
| > | Checkout the AcadX(tm) ActiveX Extension Library at:
| > |
| > | http://www.caddzone.com/acadx/acadx.htm
| > |
| > | /*********************************************************/
| > | /* Tony Tanzillo Design Automation Consulting */
| > | /* Programming & Customization for AutoCAD & Compatibles */
| > | /* ----------------------------------------------------- */
| > | /* tony.tanzillo@worldnet.att.net */
| > | /* http://www.caddzone.com */
| > | /*********************************************************/
|
| --
|
| Checkout the AcadX(tm) ActiveX Extension Library at:
|
| http://www.caddzone.com/acadx/acadx.htm
|
| /*********************************************************/
| /* Tony Tanzillo Design Automation Consulting */
| /* Programming & Customization for AutoCAD & Compatibles */
| /* ----------------------------------------------------- */
| /* tony.tanzillo@worldnet.att.net */
| /* http://www.caddzone.com */
| /*********************************************************/
0 Likes
Message 8 of 15

Anonymous
Not applicable
You can do it that way or you can just create it in the
same scope as the other reactor, and set a flag in the
latter, and check/clear the flag in the command-ended
reactor. If you chose to create or add the command
reactor in another reactor, then you would have to
remove it after it handles the command-ended notification.

Cliff Middleton wrote:
>
> Would I have to create a command-reator during the callback from the
> object-reator to fire another callback on command-ended notification?
>
> Tony Tanzillo wrote in message
> news:398ADD53.80192011@worldnet.att.net...
> | You cannot always access objects through ActiveX during some
> | reactor notifications. In this case, AutoCAD must create
> | a ActiveX wrapper for the new object before it can be accessed
> | through ActiveX, and probably can't do that until after the
> | copy notification is completed.
> |
> | You should collect the enames in list, store themin a global,
> | and then in some later notification (like command-ended) act
> | on the objects.
> |
> | Cliff Middleton wrote:
> | >
> | > R15
> | >
> | > Tony Tanzillo wrote in message
> | > news:39872E9A.9CD8E07B@worldnet.att.net...
> | > | What release of AutoCAD are you using?
> | > |
> | > | Cliff Middleton wrote:
> | > | >
> | > | > I am trying to attach reactors to a copied blockref object which has
> | > | > reactors attached. First, why don't the reactors go with the copied
> | > object
> | > | > in the first place and second, why can't you convert the ename of
> the
> | > newly
> | > | > created object to a vla-object? I get the following error values
> when
> | > the
> | > | > subr below is called:
> | > | >
> | > | > [0.61] (VL-BT)
> | > | > [1.57] (*ERROR* "Automation Error. Description was not provided.")
> | > | > [2.52] (_call-err-hook # "Automation Error.
> | > | > Description
> | > | > was not provided.")
> | > | > [3.46] (sys-error "Automation Error. Description was not provided.")
> | > | > :ERROR-BREAK.41 nil
> | > | > [4.38] (intelligent-invoke #
> | > | > "ObjectIdToObject" 1 24831232)
> | > | > [5.30] (# #
> IAcadDocument
> | > | > 00b91294> "ObjectIdToObject" 24831232)
> | > | > [6.24] (vla-ObjectIDToObject #
> | > 24831232)
> | > | > [7.18] (vlax-ename->vla-object )
> | > | > [8.13] (BDR:REACTION-COPIED #
> 04024074>
> | > | > # ())
> | > | > :CALLBACK-ENTRY.6 (:CALLBACK-ENTRY)
> | > | > :REACTOR-CALLBACK.3 :REACTOR-CALLBACK
> | > | >
> | > | > As you can see this is my first reactor attempt. Enlighten me,
> friends.
> | > | >
> | > | >
> | >
> ;BDR:REACTION-COPIED________________________________________________________
> | > | > _____________________________________________________
> | > | > ;Reactor callback to attach reactors to a copied border
> | > | >
> | > | > (defun bdr:reaction-copied (notifier-object reactor-object
> | > parameter-list /
> | > | > blockname blkref)
> | > | >
> | > | > (setq
> | > | > blockname (vlr-data reactor-object)
> | > | > blkref (vlax-ename->vla-object (car parameter-list)) ;THE NEWLY
> | > CREATED
> | > | > OBJECT
> | > | > )
> | > | > (vlr-pers
> | > | > (vlr-object-reactor
> | > | > (list blkref)
> | > | > blockname
> | > | > '((:vlr-erased . bdr:reaction-erased)(:vlr-copied .
> | > bdr:reaction-copied))
> | > | > )
> | > | > )
> | > | > )
> | > | >
> | > | > --
> | > | >
> | > | > Cliff Middleton, Tool Engineering Manager
> | > | > General Broach Company
> | > | > ph 517 458 7555 fax 517 458 6821
> | > | > ICQ 31386833
> | > | >
> | > | > Broaching...learn it, live it, love it.
> | > | > www.generalbroach.com
> | > |
> | > | --
> | > |
> | > | Checkout the AcadX(tm) ActiveX Extension Library at:
> | > |
> | > | http://www.caddzone.com/acadx/acadx.htm
> | > |
> | > | /*********************************************************/
> | > | /* Tony Tanzillo Design Automation Consulting */
> | > | /* Programming & Customization for AutoCAD & Compatibles */
> | > | /* ----------------------------------------------------- */
> | > | /* tony.tanzillo@worldnet.att.net */
> | > | /* http://www.caddzone.com */
> | > | /*********************************************************/
> |
> | --
> |
> | Checkout the AcadX(tm) ActiveX Extension Library at:
> |
> | http://www.caddzone.com/acadx/acadx.htm
> |
> | /*********************************************************/
> | /* Tony Tanzillo Design Automation Consulting */
> | /* Programming & Customization for AutoCAD & Compatibles */
> | /* ----------------------------------------------------- */
> | /* tony.tanzillo@worldnet.att.net */
> | /* http://www.caddzone.com */
> | /*********************************************************/

--

Checkout the AcadX(tm) ActiveX Extension Library at:

http://www.caddzone.com/acadx/acadx.htm

/*********************************************************/
/* Tony Tanzillo Design Automation Consulting */
/* Programming & Customization for AutoCAD & Compatibles */
/* ----------------------------------------------------- */
/* tony.tanzillo@worldnet.att.net */
/* http://www.caddzone.com */
/*********************************************************/
0 Likes
Message 9 of 15

Anonymous
Not applicable
I wrote a simple reactor to change the ltscale in autocad base on whether or
not the user was in model space or paper space. I did this to keep us from
plotting with our linetypes all messed up and at the same time reset the
ltscale so that our drawings appear correctly in model space. It worked
well, except for the annoying extra regen.

This worked fine in A2K, but seems to interfere with the cached layouts in
A2Ki and causes a fatal crash. I believe it has to do with forcing the
regen within the cached layout. If we set autocad to force regens (under
the system tab in preferences) when switching between layouts, we can still
use it in A2Ki, however, it would be nice to be able to cache the layouts to
speed things up. Does anyone know a way to test to see if a layout has been
chached, or perhaps someone has another suggestion.

On a side note, this also appears to interfere with *some* not all excel
items that we have pasted into autocad. The result is that the user cannot
switch between layouts until the reactor has been removed.

Thanks for any suggestions.
Lance

(defun C:INIT-MAINTAIN-LTSCALE ()
(vl-load-com)

;;; Establish reactor
(setq LTSCREACT (vlr-miscellaneous-reactor
"MAINTAINLTSCALE"
'((:vlr-layoutswitched . MAINTAIN-LTSCALE))
) ;_ End vlr-miscellaneous-reactor
) ;_ End setq
) ;_ End defun

(defun MAINTAIN-LTSCALE (REACT-NAME DATA)
(if (= (getvar "tilemode") 1)
(progn
(setvar "ltscale" (getvar "dimscale"))
(vla-regen (vla-get-activedocument (vlax-get-acad-object))
acallviewports
) ;_ End vla-regen
) ;_ progn
(progn
(setvar "ltscale" 1)
(vla-regen (vla-get-activedocument (vlax-get-acad-object))
acallviewports
) ;_ End vla-regen
) ;_ progn
) ;_ End if
) ;_ End defun
0 Likes
Message 10 of 15

Anonymous
Not applicable
Lance,

Not an answer to your main question, but see the thread "Ah those tricky
reactors (revisited)".
--
Eric S. eschneider@jensenprecast.com
0 Likes
Message 11 of 15

Anonymous
Not applicable
Isn't that what the PSLTSCALE variable is for?

Lance Endres wrote in message
news:C767D79E2E527C30570BC36408644F65@in.WebX.SaUCah8kaAW...
>
> I wrote a simple reactor to change the ltscale in autocad base on whether
or
> not the user was in model space or paper space. I did this to keep us
from
> plotting with our linetypes all messed up and at the same time reset the
> ltscale so that our drawings appear correctly in model space. It worked
> well, except for the annoying extra regen.
>
> This worked fine in A2K, but seems to interfere with the cached layouts in
> A2Ki and causes a fatal crash. I believe it has to do with forcing the
> regen within the cached layout. If we set autocad to force regens (under
> the system tab in preferences) when switching between layouts, we can
still
> use it in A2Ki, however, it would be nice to be able to cache the layouts
to
> speed things up. Does anyone know a way to test to see if a layout has
been
> chached, or perhaps someone has another suggestion.
>
> On a side note, this also appears to interfere with *some* not all excel
> items that we have pasted into autocad. The result is that the user
cannot
> switch between layouts until the reactor has been removed.
>
> Thanks for any suggestions.
> Lance
>
> (defun C:INIT-MAINTAIN-LTSCALE ()
> (vl-load-com)
>
> ;;; Establish reactor
> (setq LTSCREACT (vlr-miscellaneous-reactor
> "MAINTAINLTSCALE"
> '((:vlr-layoutswitched . MAINTAIN-LTSCALE))
> ) ;_ End vlr-miscellaneous-reactor
> ) ;_ End setq
> ) ;_ End defun
>
> (defun MAINTAIN-LTSCALE (REACT-NAME DATA)
> (if (= (getvar "tilemode") 1)
> (progn
> (setvar "ltscale" (getvar "dimscale"))
> (vla-regen (vla-get-activedocument (vlax-get-acad-object))
> acallviewports
> ) ;_ End vla-regen
> ) ;_ progn
> (progn
> (setvar "ltscale" 1)
> (vla-regen (vla-get-activedocument (vlax-get-acad-object))
> acallviewports
> ) ;_ End vla-regen
> ) ;_ progn
> ) ;_ End if
> ) ;_ End defun
>
0 Likes
Message 12 of 15

Anonymous
Not applicable
I want to call a lisp routine everytime the user toggles between layouts. I
am new to reactors and would appreciate it if someone could get me started
on this.

Thanks
0 Likes
Message 12 of 15

Anonymous
Not applicable
I want to call a lisp routine everytime the user toggles between layouts. I
am new to reactors and would appreciate it if someone could get me started
on this.

Thanks
0 Likes
Message 14 of 15

Anonymous
Not applicable
this one works well for us - CJ

;;Place in acaddoc.lsp
(if (not *LayoutSwitch*)
(setq *LayoutSwitch* (VLR-Miscellaneous-Reactor nil '((:VLR-layoutSwitched
. LayoutSwitched))))
)


;;; Layout Switch
;;; by Rob Starz
;;; modified by CJ Follmer

(defun LayoutSwitched (reactor layout / ds)
(if (/= (dictsearch (namedobjdict) "AEC_VARS") nil)
(progn
(setq ds (sa:AecScale))
(if (= ds nil) (setq ds 1.0))
(if (= (nth 0 layout) "Model")
(progn
;(vla-setvariable doc "ltscale" ds)
;(vla-setvariable doc "dimscale" ds)
(setvar "ltscale" ds)
(setvar "dimscale" ds)
)
(progn
;(vla-setvariable doc "ltscale" 1.0)
;(vla-setvariable doc "dimscale" 1.0)
(setvar "ltscale" 1.0)
(setvar "dimscale" 1.0)
)
)
);end progn
);end if
(princ)
)

"Keith" wrote in message
news:8E1F2D1557700D649E983FFBB7348E77@in.WebX.maYIadrTaRb...
> I want to call a lisp routine everytime the user toggles between layouts.
I
> am new to reactors and would appreciate it if someone could get me started
> on this.
>
> Thanks
>
>
0 Likes
Message 15 of 15

Anonymous
Not applicable
oops this won't work for you straight out as it calls some routines that you
don't have, but you should get the idea.

cj

"CJ Follmer" wrote in message
news:B1E9D404BABE96A0C06D0FFB91C52FC3@in.WebX.maYIadrTaRb...
> this one works well for us - CJ
>
> ;;Place in acaddoc.lsp
> (if (not *LayoutSwitch*)
> (setq *LayoutSwitch* (VLR-Miscellaneous-Reactor nil
'((:VLR-layoutSwitched
> . LayoutSwitched))))
> )
>
>
> ;;; Layout Switch
> ;;; by Rob Starz
> ;;; modified by CJ Follmer
>
> (defun LayoutSwitched (reactor layout / ds)
> (if (/= (dictsearch (namedobjdict) "AEC_VARS") nil)
> (progn
> (setq ds (sa:AecScale))
> (if (= ds nil) (setq ds 1.0))
> (if (= (nth 0 layout) "Model")
> (progn
> ;(vla-setvariable doc "ltscale" ds)
> ;(vla-setvariable doc "dimscale" ds)
> (setvar "ltscale" ds)
> (setvar "dimscale" ds)
> )
> (progn
> ;(vla-setvariable doc "ltscale" 1.0)
> ;(vla-setvariable doc "dimscale" 1.0)
> (setvar "ltscale" 1.0)
> (setvar "dimscale" 1.0)
> )
> )
> );end progn
> );end if
> (princ)
> )
>
> "Keith" wrote in message
> news:8E1F2D1557700D649E983FFBB7348E77@in.WebX.maYIadrTaRb...
> > I want to call a lisp routine everytime the user toggles between
layouts.
> I
> > am new to reactors and would appreciate it if someone could get me
started
> > on this.
> >
> > Thanks
> >
> >
>
>
0 Likes