Material is deleted when cloning
-
The Ruby methods
clone
anddup
, do NOT yet work upon SketchUp API classes.We discussed this in previous topics:
-
Thank you, I fixed my problem by processing only materials used in the model:
aMat = Sketchup.active_model.materials.current if aMat != nil and Sketchup.active_model.materials.include?(aMat) ... end
-
@dan rathbun said:
The Ruby methods
clone
anddup
, do NOT yet work upon SketchUp API classes.We should improve this. But they would not make sense for Entity based classes as instances are persistent and have to be created via entity.add_*.
-
@dan rathbun said:
I just did the following in SU2014 and got a SPLAT!
Choose a material that is not in the model.
Open console.
test = Sketchup.active_model.materials.current test.name
Choose a material that IS in the model.
test2 = Sketchup.active_model.materials.current test2.name
Everything is fine.
Now,.. try to get the name of the previous material.
test.name
-- > SPLATI cannot reproduce this. Did you submit the splat? Did you include any info I can use to look it up?
Do you see this consistently? (Can you do a video recording?) -
I do think I sent in the Splat Report.
I do not have video capture software installed (unless it comes with Windows 7?)
This was 2 weeks ago... I haven't tried since.
-
Did you enter any details into the BugSplat? (So we can search for it.)
-
I entered the steps that caused the splat, and then copied from the splat dialog, into the above SCF report.
-
SU2014 Win?
-
Ah! Found the crash report. And I realized I'd overlooked the last step in your instructions - accessing the name of the first material after it was not current any more. It's another bug where Ruby is allowed to get a handle to a transient material. I'm logging a new issue.
-
@tt_su said:
Ah! Found the crash report. ... I'm logging a new issue.
Advertisement