Concrete Setout Points for Revit Structure 2015

I was prompted by a Revit API forum discussion thread on Jeremy's setoutpoint to take another look at my SetoutPoints structural concrete setout point add-in, publish it on GitHub and migrate it from Revit Structure 2013 to 2015.

SetoutPoints is a Revit add-in for automatic placement and management of structural concrete setout points.

Setout point markers are automatically generated at all vertices of structural members. They can be manually designated as minor or major:

Minor and major structural concrete setout points

The major points are automatically numbered, scheduled and converted to global northing and easting coordinates.

The numbering can be edited and regenerated to ensure schedule consistency and readability.

Here is a collection on background and further reading on this project:

Sanjaymann took a look at this project, encountering and solving a transformation issue with some structural foundations:

Question: I was working with the setoutpoint example on structural foundations. The code places the points on one foundation but not on the other. Both of them are same family.

While debugging, the only difference that I saw was that in the case of the first foundation, the code directly retrieves a solid in the GetSolid function; in the case of the second one, it retrieves a geometry instance instead:

  /// <summary>
  /// Retrieve the first non-empty solid found for 
  /// the given element. In case the element is a 
  /// family instance, it may have its own non-empty
  /// solid, in which case we use that. Otherwise we 
  /// search the symbol geometry. If we use the 
  /// symbol geometry, we have to keep track of the 
  /// instance transform to map it to the actual
  /// instance project location.
  /// </summary>
  Solid GetSolid(
    Element e,
    Options opt,
    out Transform t )
  {
    GeometryElement geo = e.get_Geometry( opt );
 
    Solid solid = null;
    GeometryInstance inst = null;
    t = Transform.Identity;
 
    // Some columns have no solids, and we have to 
    // retrieve the geometry from the symbol; 
    // others do have solids on the instance itself 
    // and no contents in the instance geometry 
    // (e.g. in rst_basic_sample_project.rvt).
 
    foreach( GeometryObject obj in geo )
    {
      solid = obj as Solid;
 
      if( null != solid
        && 0 < solid.Faces.Size )
      {
        break;
      }
 
      inst = obj as GeometryInstance;
    }
 
    if( null == solid && null != inst )
    {
      geo = inst.GetSymbolGeometry();
      t = inst.Transform;
 
      foreach( GeometryObject obj in geo )
      {
        solid = obj as Solid;
 
        if( null != solid
          && 0 < solid.Faces.Size )
        {
          break;
        }
      }
    }
    return solid;
  }

As said, both foundations belong to the same family. Why do they behave so differently?

Answer: The difference may be caused by the fact that one foundation can use the unmodified family symbol geometry, whereas the other one needs some kind of instance specific modification, and therefore cannot use the unmodified symbol geometry. Does that make sense?

Response: Sometimes the sword fails and the needle does the job.

While looping over the corners:

  foreach( XYZ p in corners.Keys )

The point p has to be transformed:

  XYZ p1 = t.OfPoint( p );
 
  FamilyInstance fi
    = doc.Create.NewFamilyInstance( p1,
      symbols[1], StructuralType.NonStructural );

One line did the trick.

Answer: Congratulations on finding the right needle for the job!

Thank you very much for your research!

Motivated by your work, I created a GitHub repository for the SetoutPoints application and migrated it to Revit Structure 2015.

I applied the change that you suggest by adding the transformation as an 'out' parameter to the GetSolid method instead of moving the code out, cf. the GitHub diffs.

The updated solution for Revit 2015 with your transformation added is published in the SetoutPoints GitHub repository and your transformation enhancement is the content of release 2015.0.0.1.

Many thanks to Sanjaymann for his interest and research!

I hope this is of interest to others as well.