Adding text clears Sketchup window
-
Are there any known issues when adding a big amount of text to a model?
The script i have automatically creates text for each entity.
In smaller models this is no problem.
In larger models, the text is added successfully but the Sketchup model window is empty in the end. All entities are still there, invisible, but they cannot be selected nor edited... (entities.length still give a result so the model is not empty)
They are not hidden either.Could it have something to do with graphic card?
-
@pout said:
Could it have something to do with graphic card?
Maybe...
Have you tried without Hardware Acceleration?What card and version of drivers do you have?
-
Nvidia GeForce Go 7950 GTX (driver: 6.14.11.7948)
Strange thing is , with the VolumeCalculator 2 (which also creates text, all goes well.
-
Ok, never mind, i did not get a bug splat or ruby error so i thought all was correct in the code.
When a selection is empty and you execute this script:
selected= Sketchup.active_model.selection
selected.each { |e|
}This apparantly does not throw an error.
-
If you are processing a selection or entities object as if it were an array it's often best to make it an array as changing it in the each loop/block can give unexpected results as the selection/entities list might change as a result of your code [e.g. erasing]
so I'd use
ss=model.selection
and
ssa=ss.to_a -
Tig,
true, normally i always check if the array has any value or length>0
What would be the best way to check if an array has values? I assume length is the way to go?
test=[] if test==[] -->TRUE if test==nil --> FALSE if test.length<1 -->TRUE
Advertisement