Two questions about scripts I would find useful.
All  1-11  12-19

Previous
Next
 From:  Michael Gibson
11696.12 In reply to 11696.11 
Hi Frederick,

re:
> I was able to write a script that re-sequenced the "Level ###" style numbers and it seems to work fine.
>
> BUT running the script against 72 styles took far longer than I expected, 58 seconds.

Can you post the script?


> 1. Is there a means to change the cursor to the typical "busy' cursor? And change it back, or course.

There is not currently a way to do that by script, sorry.


> 2. Is there a means to trace code execution via some built-in "logging" system that messages
> could be written to?

Threre is a log you can write to by: moi.ui.log( msg ).to view log, use: moi.ui.createDialog( 'ShowLog.htm' );"

-0 Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  fcwilt
11696.13 In reply to 11696.12 
Hi Michael,

Attached is my first cut at the script to re-sequence the style names.

As to the cursor - is that something that could be added to V5?

Thanks for the info regards the log file - just what I was looking for.

Frederick

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
11696.14 In reply to 11696.11 
Hi Frederick, I tried your StylesReSequenceLevels script on the "TWO STEP IMPORTS FOR SHOWING STYLES.3dm" file and it is only taking less than 1 second to run it.

Can you post the file where it takes 58 seconds?


> As to the cursor - is that something that could be added to V5?

Yes, I've added it for the next v5 beta as: moi.ui.setBusyCursor( busy );

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  fcwilt
11696.15 In reply to 11696.14 
Hi Michael,

Good news on the cursor issue.

As to the file, even zipped it is appx 64 MB.

It's the objects that are slowing the script.

If I remove ALL of the objects it only takes a second or two to run the script.

My download limit is reported as being 50 MB - can you temporarily increase it for uploading this one file?

Or I could post the links to the two step files that I imported for testing the script.

Frederick
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
11696.16 In reply to 11696.15 
Hi Frederick,

re:
> Or I could post the links to the two step files that I imported for testing the script.

Could you please post the links or e-mail them to me at moi@moi3d.com?

But yeah if it's when you have several hundred MB of objects some things like storing undo information can become time consuming.

Taking 1 minute to process a heavy amount of objects is not particularly unexpected. It might be possible to tune it up though.

Thanks,
- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  fcwilt
11696.17 In reply to 11696.16 
Hi Michael,

Here are links to a couple of step files that may show the problem with large number of objects:

https://github.com/bigtreetech/HermitCrab/blob/master/HermitCrab2/3D/BIGTREETECH%20Hermit%20Crab%202%20CAN%20V1.0.zip

https://grabcad.com/library/btt-hermit-crab-v2-canbus-1

Frederick
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
11696.18 In reply to 11696.17 
Hi Frederick, the delay is from generating undo records for object style assignments on every name change.

You can avoid that from happening if you bracket your style modification loop with moi.geometryDatabase.styleEditorOpened(); / moi.geometryDatabase.styleEditorClosed(); like in the attached version.

With that in place it will only generate the undo record one time and should be much faster.

- Michael

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
 From:  fcwilt
11696.19 In reply to 11696.18 
Hi Michael,

I was going to ask if there was a way to disable the collection of undo information - and it turns out there is.

Thanks.

Frederick
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged
 

Reply to All Reply to All

 

 
 
Show messages: All  1-11  12-19