Visual LISP, AutoLISP and General Customization

Visual LISP, AutoLISP and General Customization

Reply
Valued Contributor
RandyBenson
Posts: 59
Registered: ‎09-22-2006
Message 1 of 11 (540 Views)
Accepted Solution

Lisp routine stops updating drawing while running

540 Views, 10 Replies
12-10-2011 10:46 AM

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

*Expert Elite*
pbejse
Posts: 2,406
Registered: ‎11-24-2009
Message 2 of 11 (530 Views)

Re: Lisp routine stops updating drawing while running

12-10-2011 07:59 PM in reply to: RandyBenson

RandyBenson 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

Valued Contributor
RandyBenson
Posts: 59
Registered: ‎09-22-2006
Message 3 of 11 (513 Views)

Re: Lisp routine stops updating drawing while running

12-11-2011 08:07 PM 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.

*Expert Elite*
pbejse
Posts: 2,406
Registered: ‎11-24-2009
Message 4 of 11 (498 Views)

Re: Lisp routine stops updating drawing while running

12-12-2011 03:58 AM in reply to: RandyBenson

RandyBenson 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

 

 

Valued Contributor
RandyBenson
Posts: 59
Registered: ‎09-22-2006
Message 5 of 11 (486 Views)

Re: Lisp routine stops updating drawing while running

12-12-2011 12:24 PM 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.

Distinguished Contributor
drago2dmax
Posts: 207
Registered: ‎10-16-2008
Message 6 of 11 (472 Views)

Re: Lisp routine stops updating drawing while running

12-12-2011 08:45 PM 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

Valued Mentor
alanjt_
Posts: 469
Registered: ‎08-25-2008
Message 7 of 11 (463 Views)

Re: Lisp routine stops updating drawing while running

12-13-2011 05:49 AM in reply to: drago2dmax

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

Valued Contributor
RandyBenson
Posts: 59
Registered: ‎09-22-2006
Message 8 of 11 (446 Views)

Re: Lisp routine stops updating drawing while running

12-14-2011 05:56 PM 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.

*Expert Elite*
pbejse
Posts: 2,406
Registered: ‎11-24-2009
Message 9 of 11 (441 Views)

Re: Lisp routine stops updating drawing while running

12-14-2011 07:16 PM in reply to: RandyBenson

RandyBenson 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.

.

 

Mentor
stevor
Posts: 835
Registered: ‎12-26-2005
Message 10 of 11 (426 Views)

Re: Lisp routine stops updating drawing while running

12-15-2011 01:36 PM in reply to: RandyBenson

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

S

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community