Author Topic: Forcing ACAD to finish operation prior to commencing new operation  (Read 3299 times)

0 Members and 1 Guest are viewing this topic.

snownut2

  • Swamp Rat
  • Posts: 971
  • Bricscad 22 Ultimate
I need to force ACAD to finish a Restore Layer state operation prior to commencing with the next operation.  Any simple way to accomplish this. I have tried to create a pausing affect by running a counter (no luck).

Thanks,

irneb

  • Water Moccasin
  • Posts: 1794
  • ACad R9-2016, Revit Arch 6-2016
Re: Forcing ACAD to finish operation prior to commencing new operation
« Reply #1 on: July 01, 2013, 01:10:52 AM »
 :-o ... you're running this in Lisp through the layerstate-restore function? Or are you using something else?

AFAIK all Lisp calls are synchronous, thus the next item will only happen once the 1st has completed. In VBA you sometimes find asynchronous behaviour.

If you mean you ran a loop checking the CDate at each interval, then exiting the loop once reaching a specified period - that's probably not going to work. The issue is the loop itself is using up all the CPU time slicing allowed for the thread, so nothing else can actually do any work. If you mean you used the WAIT command, I'm not too sure why you'd even need to accomplish this - shouldn't the restore have completed before a command is allowed to be started? Sorry, I don't know of another way to pause Lisp - not without some external help (like a DotNet / ARX).

Anyhow, if your layer list is so long that the restore takes a meaningful time, you might want to use some object modified reactors on the layer names. This is probably total overkill, and is probably going to slow down the process even more, so I'd not recommend it.

Could you possibly post some code, so we can more easily find out what the issue might be?

Edit: Ohhhhh! Just realized you're on BricsCAD! It probably does an asynchronous version of Lisp! Ouch!

If this is the case, then it might be a good idea for the BC guys to add a call-back function to use when such async operation has completed.
« Last Edit: July 01, 2013, 01:14:54 AM by irneb »
Common sense - the curse in disguise. Because if you have it, you have to live with those that don't.

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: Forcing ACAD to finish operation prior to commencing new operation
« Reply #2 on: July 01, 2013, 01:29:00 AM »
< ..> Just realized you're on BricsCAD! It probably does an asynchronous version of Lisp!

Do you have anything to back that up ??
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

irneb

  • Water Moccasin
  • Posts: 1794
  • ACad R9-2016, Revit Arch 6-2016
Re: Forcing ACAD to finish operation prior to commencing new operation
« Reply #3 on: July 01, 2013, 01:32:06 AM »
Do you have anything to back that up ??
No, only the OP's post.

Anyhow, async is a much more efficient thing than ACad's sync version of Lisp. It means any lisp function won't hog the UI-thread as it does in ACad. So my guess is that BC is using the more complex separate threadded model, though I have no proof of this - I'm grabbing at straws  :roll:
Common sense - the curse in disguise. Because if you have it, you have to live with those that don't.

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: Forcing ACAD to finish operation prior to commencing new operation
« Reply #4 on: July 01, 2013, 01:40:43 AM »
You're one of a few people I know who takes 20 lines and 3 paragraphs to say  " haven't got a clue " My grandfather called it 'verbal diarrhea' and that was before the internet. :-)

kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

irneb

  • Water Moccasin
  • Posts: 1794
  • ACad R9-2016, Revit Arch 6-2016
Re: Forcing ACAD to finish operation prior to commencing new operation
« Reply #5 on: July 01, 2013, 07:08:51 AM »
You're one of a few people I know who takes 20 lines and 3 paragraphs to say  " haven't got a clue " My grandfather called it 'verbal diarrhea' and that was before the internet. :-)
:-P My motto ... always use 20 words or more ... no matter what!  :evil: So here goes the rest of my post for no other reason that to fill up those words.  :laugh:
Common sense - the curse in disguise. Because if you have it, you have to live with those that don't.

irneb

  • Water Moccasin
  • Posts: 1794
  • ACad R9-2016, Revit Arch 6-2016
Re: Forcing ACAD to finish operation prior to commencing new operation
« Reply #6 on: July 01, 2013, 07:10:19 AM »
Jokes aside though, you do understand why the 2nd paragraph in that previous post?
Common sense - the curse in disguise. Because if you have it, you have to live with those that don't.

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: Forcing ACAD to finish operation prior to commencing new operation
« Reply #7 on: July 01, 2013, 08:22:23 AM »

I'd have just asked the OP how he was running the command and what he was running it on. :)

.. then gone for a beer and waited to see if the OP came back.
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.