Hi,
Let me start by saying thanks for this plugin, it's great.
I've started using it to import models from Structure Sensor.
I decided to do a little hacking to make my life easier; basically setting the units to default to metres and taking a look at how to bulk import mesh models (todo). I also discovered that when the models were loading in the background/covered by another window, they loaded much faster (I'm on OSX/'14 Make).
The reason for this is because the UI is getting hammered with several tens/hundreds of thousands of repaints (1 per obj file line) to updated the status bar from this:
Sketchup.set_status_text("Processing line #{line_cnt} of #{lines.length}")
I took a crack at fixing this by making the status line update on a change in percentage. I obviously screwed it up not being a ruby coder, but in the process discovered my 40K+ line (991kb) models loaded in about 2 seconds.
It still slows down when you get really big models; I have a 13.2MB file that starts to grind after about 90%, but I suspect this is a memory/swap bottleneck.
Anyway, I fixed my update code and it looks like this:
Initialize the percentage variables before the looping starts
old_percentage=-1
new_percentage=0
### trap in case of a missing 'g'
lines=["g OBJ\n"]+lines
Update the status and force sketchup to repaint once per percentage point.
# Sketchup.set_status_text("Processing line #{line_cnt} of #{lines.length}")
new_percentage = ((line_cnt * 100.0)/lines.length).round;
if old_percentage != new_percentage
Sketchup.set_status_text("Importing Model - #{new_percentage}% (#{line_cnt} of #{lines.length})")
end#if
old_percentage = new_percentage
Probably something that would help others enjoy this plugin a little more.
-G