Crashing script in for loop
Geoff Elson 7 years ago in Scripting • updated 7 years ago • 7
I am trying to calculate the distance between each composite xyz and the nearest composite xyz from a different drillhole but my script is crashing.
I have changed the range upper limit to 10, 100 and 700 and it works but when I go to record_count MM crashes. Any advice would be helpful.
Customer support service by UserEcho
Посмотрите, нет ли в файле пустых строк.
No blanks, that was something I looked into. Thanks.
How many rows do you have in your file? If the number is too large, it is possible that MM doesn't respond when the script in process. I also have few comments about your script:
Both scripts have a function to generate a temporary file for testing. Try to implement one of this approaches (the first one is a clear Python, so you don't need to install anything) and tell me whether it works or MM still crashes.
Pavel, thanks for your expert advice. As you may have guessed I am beginner and couldn't quite manage implementing a more elegant array approach.
I can learn a lot from your code, thanks for providing.
The Paired Samples function on the Stats menu in Micromine might help you measure distances more easily/efficiently. You can enter the assay file as file 1 and file 2 but then you'll have to use some form of database query or python script to remove pairs where the hole-ids are the same and to get the closest match.
Thanks Rupert, but I got around to Pavel's code with a bit a prep and got the script working.
The modification I made was first using "at change increment" in the composite file followed by "replicated" to make temporary numeric drill hole codes so the script would only look at other drill holes and it is easier with the get_num only.
Any way the results are exactly what I need. Can't say thank you enough, I now have a new tool in my toolbox.