When I add a new instance definition to the document instance definition table, and then create an instance of that block, it only appears in the rhino viewport intermittently - I can select it but can only see it sometimes. Zooming around it will occasionally reveal it. However, if I select it and run the “BlockEdit” command and then click OK, it seems to resolve the issue.
disappearingBlock.3dm(1.1 MB)
My code, in a GH C# script, to define the block, looks like this:
private void RunScript(bool activate, List<GeometryBase> geom, string name, Point3d basePt, List<object> atts, ref object A)
{
if(activate){
List<Rhino.DocObjects.ObjectAttributes> attsList = new List<Rhino.DocObjects.ObjectAttributes>();
foreach(object o in atts){
attsList.Add(o as Rhino.DocObjects.ObjectAttributes);
}
if (RhinoDocument.InstanceDefinitions.Find(name.Trim(), true) == null){
RhinoDocument.InstanceDefinitions.Add(name, "", basePt, geom, attsList);
} else {
Print("A block by that name already exists");
}
}
A = name;
}