Site Tools


Differences

This shows you the differences between two versions of the page.

Link to this comparison view

developer:sdksamples:showallhiddenobjects [2015/09/14] (current)
Line 1: Line 1:
 +====== How To: Show All Hidden Objects ======
 +> **Developer:​** //​[[developer:​cplusplusplugins|C++]]//​
 +> **Summary:​** //​Demonstrates how to iterate through the geometry table and unhide hidden objects.//
  
 +===== C++ =====
 +<code c++>
 +int ShowAllHiddenObjects( CRhinoDoc&​ doc, bool bRedraw )
 +{
 +  CRhinoObjectIterator it(
 +        doc,
 +        CRhinoObjectIterator::​undeleted_objects,​
 +        CRhinoObjectIterator::​active_and_reference_objects
 +        );
 +  it.IncludeLights();​
 +
 +  int count = 0;
 +  CRhinoObject* obj = 0;
 +  for( obj = it.First(); obj; obj = it.Next() )
 +  {
 +    // Ignore objects that are not hidden
 +    if( obj->​Attributes().Mode() != ON::​hidden_object )
 +      continue;
 +    // Ignore objects on hidden or locked layers
 +    if( ON::​normal_layer != obj->​ObjectLayer().Mode() )
 +      continue;
 +    if( doc.ShowObject(obj) )
 +      count++;
 +  }
 +
 +  if( count > 0 && bRedraw )
 +    doc.Redraw();​
 +  return count;
 +}
 +</​code>​
 +
 +{{tag>​Developer cplusplus}}
developer/sdksamples/showallhiddenobjects.txt ยท Last modified: 2015/09/14 (external edit)