Automatic Regen

Automatic Regen

dbrblg
Collaborator Collaborator
15,435 Views
19 Replies
Message 1 of 20

Automatic Regen

dbrblg
Collaborator
Collaborator

Other than the FIELDEVAL command, is there any other way which can force a regen? 

 

What I would like is for a regen after a dynamic grip has been moved.....

 

 

0 Likes
15,436 Views
19 Replies
Replies (19)
Message 2 of 20

wispoxy
Advisor
Advisor
REGENMODE (System Variable)
Jul 08 2014 | In-Product View

Applies to AutoCAD LT 2015
Like (0)
Share

Controls automatic regeneration of the drawing.
Type: Integer
Saved in: Drawing
Initial value: 1

0


Prevents automatic regeneration for commands (for example, when thawing layers)

1


Allows automatic regeneration for certain commands

The REGENAUTO command also controls this setting (not available in AutoCAD LT).
Related Concepts

About Improving Speed by Displaying Simplified Objects

Related Reference

Commands for Object Visibility
0 Likes
Message 3 of 20

wispoxy
Advisor
Advisor
Command RE
Command REGEN
0 Likes
Message 4 of 20

dbrblg
Collaborator
Collaborator

@Anonymous wrote:
REGENMODE (System Variable)

Controls automatic regeneration of the drawing.
0
Prevents automatic regeneration for commands (for example, when thawing layers)
1
Allows automatic regeneration for certain commands

The REGENAUTO command also controls this setting (not available in AutoCAD LT).

Commands for Object Visibility

REGENMode is already set to 1 and REGENAUTO is ON.

 

Changing these dont seem to have made any difference.

0 Likes
Message 5 of 20

wispoxy
Advisor
Advisor
Just making sure you know about REGEN
0 Likes
Message 6 of 20

dmfrazier
Advisor
Advisor

"...a regen after a dynamic grip has been moved..."

 

I assume you mean for this to be "automatic".  I don't know of any "setting" or option that would cause an automatic regen after manipulating a grip (in fact, I think this would be extremely annoying in most circumstances).

 

(Just curious, but why do want this behavior?)

 

Perhaps a simple strategy would be to create a toolbar button or define a mouse button or right-click button to run the REGEN command.

 

See Help for those subjects.

0 Likes
Message 7 of 20

dbrblg
Collaborator
Collaborator

@dmfrazier wrote:

"...a regen after a dynamic grip has been moved..."

 

I assume you mean for this to be "automatic".  I don't know of any "setting" or option that would cause an automatic regen after manipulating a grip (in fact, I think this would be extremely annoying in most circumstances).

 

(Just curious, but why do want this behavior?)

 

Perhaps a simple strategy would be to create a toolbar button or define a mouse button or right-click button to run the REGEN command.

 

See Help for those subjects.


In my case, and I suspect there are many others too, I want to update a field in the block.

 

After I have moved the grip I want the value displayed to be accurate ie what position the grip is now.  I could have the situation where the user has not regen'ned after changing the grip and the previous value is displayed which could be a costly mistake. 

 

Would be good if as part of the actions / parameters of a dynamic block contained pre/post triggers to attach .net (or lisp at least) scripts.

0 Likes
Message 8 of 20

dmfrazier
Advisor
Advisor

"In my case, and I suspect there are many others too, I want to update a field in the block."

 

Yes, now I see. Thank you.

 

A modification to the FIELDEVAL variable, in the form of a new setting to "update on grip-edit" (assuming that's feasible), would do the trick.

 

"Would be good if as part of the actions / parameters of a dynamic block contained pre/post triggers to attach .net (or lisp at least) scripts."

 

Yes. Or simply the ability to assign a basic AutoCAD command as a sort of "chain action".

0 Likes
Message 9 of 20

Anonymous
Not applicable

Totaly agree.

This is must have feature. I have to manually regen fields after changing grips in my dynblocks and if I forget, this might cause a serious mistake.

0 Likes
Message 10 of 20

rkmcswain
Mentor
Mentor
dbrblg wrote:

REGENMode is already set to 1 and REGENAUTO is ON.

Changing these dont seem to have made any difference.

Of course not. That's not what REGENAUTO is for.

Just want to clear that up for future readers of this thread.

 

REGANAUTO is to *prevent* automatic regens from occurring when OFF.

It's purpose is not to cause additional regens to occur when ON.

 

 

 

 

 

R.K. McSwain     | CADpanacea | on twitter
0 Likes
Message 11 of 20

rkmcswain
Mentor
Mentor
vavalexus wrote:

This is must have feature. I have to manually regen fields after changing grips in my dynblocks and if I forget, this might cause a serious mistake.

How so?

Even with REGENAUTO turned off, as long as FIELDEVAL is set correctly (31), the drawing will regen each time it's opened or plotted.

You may be able to define a reactor (editor or object?) that can capture the moment your dynamic block is modified, then fire the REGEN command automatically.

You can define a reactor to keep FIELDEVAL (and/or any other sysvar) from being modified.

R.K. McSwain     | CADpanacea | on twitter
Message 12 of 20

dbrblg
Collaborator
Collaborator

I think the point here is that the ideal situation for us is to have the drawing or block regen when a grip is moved.  Even with FIELDEVAL set to 31, the drawing or block wont automatically regen when a grip is moved or repositioned because the drawing hasn't been opened, saved, plotted or regen'd. 

 

Even if the drawing or block cannot automatically be regen'd, an alternative would be for fields within a dynamic block to automatically update when grips are repositioned which is really what this is all about.

 

 

0 Likes
Message 13 of 20

rkmcswain
Mentor
Mentor
The second to last post on this page contains code to create a reactor that WILL regen upon a grip edit stretch.

http://www.cadtutor.net/forum/archive/index.php/t-61533.html?s=bc8befdf36029698cbce8f0ed8500cdf

R.K. McSwain     | CADpanacea | on twitter
0 Likes
Message 14 of 20

rkmcswain
Mentor
Mentor

For your grip editing pleasure..... Smiley Happy

 

 

R.K. McSwain     | CADpanacea | on twitter
Message 15 of 20

dbrblg
Collaborator
Collaborator

Very interesting, thanks for this Smiley LOL

0 Likes
Message 16 of 20

Anonymous
Not applicable

Thank you for the link to the reactor.

I've never heard about it before. I got the meaning, but failed to get it working.

 

I've loaded the lisp:

(defun ss->lst ( ss flag / id lst )
(repeat (setq id (sslength ss))
(
(lambda ( name )
(setq lst
(cons
(if flag (vlax-ename->vla-object name)
name
)lst
)
)
)(ssname ss (setq id (1- id)))
)
)
)

(vlr-command-reactor "FieldUpdate"
(list (cons :vlr-CommandEnded 'Regen))
)


(defun Regen ( react data / ss )
(cond
( (and (equal data '("GRIP_STRETCH"))
(setq ss (ss->lst (ssget "_p") t))
(vl-position "airspace"
(mapcar (function vla-get-effectivename)
(vl-remove-if-not
(function 
(lambda ( x )
(vlax-property-available-p x 'EffectiveName)
)
)ss
)
)
)
)
(vlax-invoke 
(vlax-get (vlax-get-acad-object) 'ActiveDocument)
'Regen acActiveViewport
)
)
)
(princ)
)

And I was hoping it will auto trigger when I use any grips (at the moment I am using stretch and visibility change grips). But nothing happens, fields do not update.

I would really appreciate some help.

0 Likes
Message 17 of 20

Anonymous
Not applicable

I would also like to know how to implement this lisp/reactor to work with the fields in my blocks. I have field attributes that are tied to lookup tables in my block. I would like for a "regen" to occur each time that a selection is made on the lookup table so that the attribute will seamlessly update with the selection made on the lookup table. 

 

I have attached an example file that contains two of my more complicated blocks. The attributes that I'd like to update are circled in the file. Just click on the block and make a selection from the lookup table and then "regen" to see the change. 

0 Likes
Message 18 of 20

mantsoft
Community Visitor
Community Visitor

Maybe what people try to do with an AUTO REGEN is the same as Using VIEWRES with fast zooms and 20000 value.

 

0 Likes
Message 19 of 20

Moshe-A
Mentor
Mentor

@mantsoft hi,

 

Are aware that this thread is seven years old?

 

 

0 Likes
Message 20 of 20

mantsoft
Community Visitor
Community Visitor

yes

7 years after Im looking for the same answer...  Im not the only one for sure.