I’ve isolated the issue with the function FamilyInstance.ByCurve; and I provide a test case that displays the issue.
The issue occurs when Dynamo is running against an RFA document rather than a RVT document, ie, in the Family Editor mode.
In the examples given, open in-project-edit.rvt and test-two-point-place.dyn using the latest Clockwork package.
The example will create a copy of the two-point family correctly.
Now open in-family-edit.rfa and test-two-point-place-rfa.dyn. This example will produce a ‘null’ output from the FamilyInstance.ByCurve node, but no other error is indicated. The opject will not be copied despite the curve being created and a level (Ref Level) being selected.
There is probably something within the FamilyInstance.ByCurve node that is calling the Document, and there is something different about either the Document or the Level when you are in the Family Editor.
@Adrian_Esdaile - I had a look into the Revit API documentation. Unfortunately the method used here for project documents is not available for family documents in the Revit API.
I have written a lovely set of Dynamo graphs that can take any objects from a RVT model and turn them into a ‘super-family’ of nested components; but it only works for “single-click” objects. “two-click” objects (NOT Adaptive Families / Components) or “line-based families” don’t work with my graph, annoyingly. Or rather they do work, but once placed as a ‘single-click’ object they then behave as a ‘single-click’ object unless edited directly using the mouse. Confusing - and it feels like a bug in Revit and/or it’s API to me. It’s theoretically possible to calculate a rotation from a vector of the source object, but once you have placed a “two-click” object using Dynamo it ‘locks’ in place and cannot be manipulated by further nodes the same way a ‘single-click’ can.
With a ‘single-click’ object you can place an instance, then use SetRotation or Move by Vector to manipulate it; but if you place a “two-click” object it refuses to respond to further nodes; but it doesn’t throw any errors, thus making it very difficult to diagnose what is or isn’t happening.
Whats odd is that you can place line-based families in the UI; so the method must be there - its just not exposed in the API.
I’ll try to clarify all this with some further examples and the full graphs to show what I’m trying to achieve.
Edit: that might need a whole new post - they are some mighty big graphs…