End an infinite loop (end a command) after certain time

End an infinite loop (end a command) after certain time

Anonymous
Not applicable
1,894 Views
14 Replies
Message 1 of 15

End an infinite loop (end a command) after certain time

Anonymous
Not applicable

AUTODESK should create a simple command that will end any command after a user-defined time.

 

Can you make a script for that?


With my computer configuration, I would probably set the time to 10 seconds, because any command that runs more than 10 seconds on my computer is an endless loop, and I would probably need to force close the program and lose data.

0 Likes
1,895 Views
14 Replies
Replies (14)
Message 2 of 15

pendean
Community Legend
Community Legend
Why not fix the reason your AutoCAD hangs and freezes all the time instead?
Your AutoCAD variant and year version as listed in ABOUT command is what?
Your Windows OS is what?
Your video card is what?

Otherwise... Customization forums are here to help you code whatever you want if it is possible, Autodesk is never going to do what you wrote https://forums.autodesk.com/t5/autocad-customization/ct-p/AutoCADTopic1

Message 3 of 15

JTBWorld
Advisor
Advisor

What commands are you having problem with? 


Jimmy Bergmark
JTB World - Software development and consulting for CAD and license usage reports
https://jtbworld.com

0 Likes
Message 4 of 15

Anonymous
Not applicable

I don't believe you can fix the reasons 😄

I would say that the reason AutoCAD is slow is because of single core limits.

 

I use Autocad 2019 Civil 3D with
Windows 10

intel i7 8700k

Quadro P2000

 

which are close to the top of available equipment.

The biggest problems arise with commands like trim or selection commands (because I sometimes select too many objects --- my drawings sometimes have more than 200 000 objects).

 

 

Thank you for the suggestion to visit the customization forum. I will sure do that.

0 Likes
Message 5 of 15

Anonymous
Not applicable

jbtworld it doesn't really matter what commands are used because this isn't a topic about that, it's a topic to end any command after a certain time.

 

I read all the "advices" for trim, etc... "zoom in", "turn off object snap" etc etc... They are not the help I want at this time.

0 Likes
Message 6 of 15

Alfred.NESWADBA
Consultant
Consultant

Hi,

 

>> I would probably set the time to 10 seconds

Would cause my system to never save files ... I can't agree to that wish.

 

If your workstation/AutoCAD/drawing is slower than you expect we can go into details what happens when and try to find the source of the issue.

 

- alfred -

------------------------------------------------------------------------------------
Alfred NESWADBA
ISH-Solutions GmbH / Ingenieur Studio HOLLAUS
www.ish-solutions.at ... blog.ish-solutions.at ... LinkedIn ... CDay 2026
------------------------------------------------------------------------------------

(not an Autodesk consultant)
0 Likes
Message 7 of 15

ВeekeeCZ
Consultant
Consultant

Yeah... I know the issue. 

 

Sometimes I forget that I should change my usual workflow and use BREAK rather than TRIM and if TRIM then pick a certain boundary rather than to all. 

Usually, it's not an infinite loop. It just takes a ridiculous mount of time to finish the job.

 

ADSK should take care of it. Can't imagine a 'script' that could do that.

0 Likes
Message 8 of 15

JTBWorld
Advisor
Advisor

In that case you should really talk to your reseller or Autodesk support to see why this happens and how to avoid it, as a program to cancel commands like this would not be possible to create. 


Jimmy Bergmark
JTB World - Software development and consulting for CAD and license usage reports
https://jtbworld.com

0 Likes
Message 9 of 15

ВeekeeCZ
Consultant
Consultant

@Anonymous wrote:

...

The biggest problems arise with commands like trim or selection commands (because I sometimes select too many objects --- my drawings sometimes have more than 200 000 objects).

...


 

There is no other solution than try to change the workflow. If you record your doing eg. by SCREENCAST we could try to suggest something. Some workarounds..

But ADSK is the only one who can fix this. Make possible reasonable work with a large number of entities.

0 Likes
Message 10 of 15

Anonymous
Not applicable

But I am suggesting a userdefined time. For instance, you can type "MENUBAR" and set a value of the function. Equivalently, you can do also this. Default is 0 which means: not applicable, and user can set any time he/she wants. I just said that for me it would be 10 seconds.

 

I believe the reason is just the size of the files. Some of them are around 100 MB with 200.000 polylines/3dpolylines/...

0 Likes
Message 11 of 15

Anonymous
Not applicable

jbtworld why wouldn't it be possible to create?

 

In any programming language you can solve this problem with three lines

 

"if iteration_number>1000

stop_command

end"

 

(1000 as an example)

 

And that is very very simple. I bet you can also set that to use a time variable.

0 Likes
Message 12 of 15

JTBWorld
Advisor
Advisor

You need to suggest this to Autodesk one way or another, this is a user forum for peer support. 


Jimmy Bergmark
JTB World - Software development and consulting for CAD and license usage reports
https://jtbworld.com

0 Likes
Message 13 of 15

JTBWorld
Advisor
Advisor

Autodesk can fix it but a 3rd party developer can't fix this. Autodesk is not reading this or at least you can't count on that they do.  


Jimmy Bergmark
JTB World - Software development and consulting for CAD and license usage reports
https://jtbworld.com

0 Likes
Message 14 of 15

Alfred.NESWADBA
Consultant
Consultant

Hi,

 

>> For instance, you can type "MENUBAR" and set a value of the function

Ever thought about supporting such a system, knowing that not only professionals are sitting in front of the system?

Some user turns that to 0.01sec ... and he will not be able to use that variable any more.

 

>> In any programming language you can solve this problem with three lines

>> "if iteration_number>1000

>> stop_command

>> end"

...and half of your points are now imported to your Civil 3D surface, but the surface is not rebuild yet ... that's not a valid point to stop anything. And it does not make sense to stop it because you need all points to be used inside the surface...

 

It's like break the service of your car at 30min ... even if the old engine oil is out, but not a new one filled in. Does not make sense.

 

And as you might already have seen in AutoCAD or your Civil 3D, even an undo needs more time than the command execution itself to bring back what you had before.

 

- alfred -

------------------------------------------------------------------------------------
Alfred NESWADBA
ISH-Solutions GmbH / Ingenieur Studio HOLLAUS
www.ish-solutions.at ... blog.ish-solutions.at ... LinkedIn ... CDay 2026
------------------------------------------------------------------------------------

(not an Autodesk consultant)
Message 15 of 15

Kent1Cooper
Consultant
Consultant

@Anonymous wrote:

But I am suggesting ....


This is not the place.  Go to the >Product Feedback page<.

Kent Cooper, AIA
0 Likes