DesignCAD 3D Max 2027 box
Now available

DesignCAD 2027

Hatches that follow their boundaries, an on-screen dial to turn your model, and a way to find any command by name, in a clean Windows 11 look.

Monitoring Macro Progress during execution

Started by samdavo, March 28, 2013, 05:57:29 PM

Previous topic - Next topic

0 Members and 0 Guests are viewing this topic.

samdavo

I just had occasion to want to check on the progress of a macro during execution.

I decided to do it by moving things to the right by a "skip" of 20 units, at a given point in the macro ...
and (during running of the macro) checking where the macro had progessed to by checking if the skip had happened or not.

Refer reply #16 on :-
http://forum.designcad.com/index.php?topic=4861.msg31045#new 

It would be possible to add a number of such "skips" at various "steps" in the macro, and then plot the progress of the macro by observing the skips during execution thereof.

But I'm guessing there's an easier way (?)
(and my Heath Robinson method is super-clumsy)
Anyone know a better one and/or can set me straight on this?
thanks, sam

samdavo

#1
OK ... This would have been a better way to monitor progress.
Here is a macro (sorry, another version of the super-regen macro - but purely because only some macros permit sensible monitoring - or warrant monitoring of progress - and this is one that I can use an an example).

By that I mean that some of the best macros interrogate each of thousands of entities in turn, and it is arguably meaningless to tell us that it was 30% complete etc.

But you will find (just as an example of adding "Monitoring Messages" to a macro, that super-regen4 does just that, and displays messages which cause a pause, and require "enter" to move to the next step being offered in the message.

But (again) there is probably a better way to achieve this. And I invite comment on that matter.

(PS there are 4 lines in that drawing, but you probably won't discover that till you run the macro).
PPS I use the low-left corner of the lines as the handle, rather than the origin - purely so that you will have a better chance of watching that happen on the available screen when you get to the step of "setting handles" etc.
PPS "Message" has the effect of pausing the macro at that point. and move on when you are happy with "progress to date".

PPS You have to run this particular macro with Q\general\"select object when created" unclicked.  But it's more about following the progress in general, than this particular macro. - 2 cents

paulerens

Sam,
In my opinion you destroy your copy.
The copy remains selected and then you <SelectDelete>
To select the first original, you can do <SelectPrevious>

prl

sam

Yes, the Message statement will do what you need, or equivalently use the Print statement followed by Anykey.  If you are interested in watching every step, add Sys(800) = 1 to the beginning of your routines. This invokes the debug trace mode.


.
.
.

print "Working step 1"
anykey

>SelectAll
{
}

print "Working step 2"
anykey

.
.
.


samdavo

#4
Quote from: paulerens on March 29, 2013, 12:50:35 AM
Sam,
...
The copy remains selected and then you <SelectDelete>
...
Paul
thanks,
Can I assume you use "select object when created" clicked rather than (what I use ) unclicked?
That would explain us getting a different result.
i.e. the copy (for me) is not selected (as you say).
Basically I have proven my macro with this interrogation, subject to that setting.

prl
"debug trace mode" - well that was what I was after with the first post.   I'll keep that one in the toolkit for next time thanks. 

paulerens


DrollTroll

There's a sys function for that. It should be possible to store the original setting, turn off "Select when created" during the macro, and restore it when done.
25 years with DesignCAD