- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Please refer to attached solution files which provides minimum reproducible case for the unexpected API behaviour I am experiencing. There is a Revit project file within the solution called SampleProject.
Whilst using the following NewFamilyInstance overloads:
ItemFactoryBase.NewFamilyInstance(Reference, Line, FamilySymbol)
ItemFactoryBase.NewFamilyInstance(Face, Line, FamilySymbol)
I am getting the exception ArgumentsInconsistentException with message “Family cannot be placed on this line as it does not coincide with the input face.”
I know that the line is coincident with the input face to a reasonable degree by comparison of coords and it is a curve resulting from the intersection of the input face with another face (so must be coincident with the input face).
I believe the error is occurring because the test for compatibility is being conducted between a curve in instance space and a face is the symbol space of the originating geometry. I surmise this due to the fact that an uncut family instance (which inherently has solids transformed to instance space) throws the exception whilst a cut family instance (which inherently has solids in the instance position without transformation) does not.
It can be further demonstrated that if the curve is transformed into symbol space then the exception is not thrown (since presumably comparison occurs between curve and face both in symbol space). However, when doing this the created hosted instance is not in a position that would be permissible in the UI i.e. it is in symbol space remote from the host element.
Obviously if there is a better approach or I’m doing something wrong let me know. I don’t think I’m expected to add the instance in the wrong place and then move it to the right place etc. I believe this is an issue that has to be rectified in the API. Since it will currently work one way for walls, floors etc where solids are at the top level in the geometry tree but will fail for uncut family instances.
Solved! Go to Solution.