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

Lisp routine stops updating drawing while running

10 REPLIES 10
SOLVED
Reply
Message 1 of 11
RandyBenson
1696 Views, 10 Replies

Lisp routine stops updating drawing while running

Forgive the abstract question without showing any code - the lisp routine is very large:

I'm a surveyor. Our data collector saves (ascii) raw data, which logs all the measurement data for the 'shots' we take in the field.

I wrote a routine that works fine. It parses the raw data file from our survey data collector and recreates the survey in the drawing. It creates a 'point block' at the coordinates each shot and populates it with attributes for point number, description and elevation. If the shot represents certain entities (trees, manholes, area drains, etc.) it inserts the appropriate symbols.

Everything works, BUT... it used to be enjoyable to watch everything happening on screen, but now AutoCAD draws the first few point blocks, symbols, etc. and then freezes until the routine is finished, when everything appears at once.

Can anyone tell me what causes this behavior and if there's anything I can do or rewrite to bring back the old behavior?

TIA,

Randy Benson

Win7

Dell Precision T3500 x64 8M ram

Civil 3d 2012

10 REPLIES 10
Message 2 of 11
pbejse
in reply to: RandyBenson


@Anonymous wrote:

Forgive the abstract question without showing any code - the lisp routine is very large:

I'm a surveyor. Our data collector saves (ascii) raw data, which logs all the measurement data for the 'shots' we take in the field.

I wrote a routine that works fine. It parses the raw data file from our survey data collector and recreates the survey in the drawing. It creates a 'point block' at the coordinates each shot and populates it with attributes for point number, description and elevation. If the shot represents certain entities (trees, manholes, area drains, etc.) it inserts the appropriate symbols.

Everything works, BUT... it used to be enjoyable to watch everything happening on screen, but now AutoCAD draws the first few point blocks, symbols, etc. and then freezes until the routine is finished, when everything appears at once.

Can anyone tell me what causes this behavior and if there's anything I can do or rewrite to bring back the old behavior?

TIA,

Randy Benson

Win7

Dell Precision T3500 x64 8M ram

Civil 3d 2012


 

 

It would be difficult to tell without being able to look at your code. there are many factors for a program to behave as the way you describe, 

 

  • Method used to insert the block .i.e via command or vl
  • Sequence
  • Drawing settings

 

 Is  run time  faster when  "everything appears at once" ? Iif so, i'll stick with it, if there are  no difference in speed at all and you're still using the same code as before but behaves differently from one drawing to another then its probably drawing settings.

 

Oh well.. canot suggest  anything until i test the code myself though.

 

HTH

Message 3 of 11
RandyBenson
in reply to: pbejse

Thanks for your comments.

 

It happens in every drawing, not just some.

The blocks are all existing blocks that are inserted with 'command'.

The only change I can think of other than newer Civil 3d version is that I've modified the point block definitions to make them annotative (but the code that inserts them hasn't changed at all).

Hard to tell if it runs any faster when the drawing stops updating - it seems about the same, just locked up until the routine finishes.

 

I realize it's virtually impossible to diagnose without the code, I just wondered if anyone had any similar experiences.

Message 4 of 11
pbejse
in reply to: RandyBenson


@Anonymous wrote:

Thanks for your comments.

 

 I realize it's virtually impossible to diagnose without the code, I just wondered if anyone had any similar experiences.


Thats too bad. I wrote a test code with varying methods of inserting blocks but i cant seem to recreate your "experience"

You may have something there when you mentioned you converted your block to annotative, that might have change the insert sequence if somehow your block now is uniformly scaled. does it report any errors after the routine is done?

 

ATTREQ value perhaps? CMEDECHO?

 

Anyhoo keep me posted when you figure out whats causing that "event". dont have the latest cad version to know weither a new system variable  affects your code or not

 

Cheers

 

 

Message 5 of 11
RandyBenson
in reply to: pbejse

No errors - like I said, the routine successfully runs to completion and adds everything it is supposed to add to the drawing database. It just stops updating the screen while it runs and then updates everything at once when it finishes. I can live with the behavior if I have to, it would just be more fun to watch if the screen updated at each instance where it added something to the drawing.

Message 6 of 11
drago2dmax
in reply to: RandyBenson

I done have the answer, but you can read similar issues in these links

http://www.theswamp.org/index.php?topic=39931.0

http://www.theswamp.org/index.php?topic=40107.0

Message 7 of 11
alanjt_
in reply to: drago2dmax

Simple solution: execute command; go get coffee; come back to completed command.

Message 8 of 11
RandyBenson
in reply to: RandyBenson

Thanks, that sounds like what's happening.

I guess it's time to hunker down and rewrite everythinig in C#.NET.

Message 9 of 11
pbejse
in reply to: RandyBenson


@Anonymous wrote:

Thanks, that sounds like what's happening.

I guess it's time to hunker down and rewrite everythinig in C#.NET.


Dont give up yet. tell you what, post that code (or attached) and we'll help you solve that mystery together.

.

 

Message 10 of 11
stevor
in reply to: RandyBenson

Randy, before hunkering away, try with some explicit commands, like Zoom, redraw, or regen, entered periodically in the code.

S
Message 11 of 11
RandyBenson
in reply to: stevor

After perusing the related threads at the Swamp, it seems that this is the root of the problem:

 

The lisp routine is running inprocess within the user interface thread AutoCAD and if the thread runs for long enough, Windows 7 will throw the 'spinning frisbee'.

 

"As the OS communicates with a running program through the UI thread, acad can only reply to such communication if the UI thread is idle." - Irneb @ theSwamp

 

 

 

 

 

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

Post to forums  

Autodesk Design & Make Report

”Boost