NewFamilyInstance(Other familyinstance, Curve Other familyinstane, Symbol) Is it

NewFamilyInstance(Other familyinstance, Curve Other familyinstane, Symbol) Is it

Anonymous
Not applicable
806 Views
3 Replies
Message 1 of 4

NewFamilyInstance(Other familyinstance, Curve Other familyinstane, Symbol) Is it

Anonymous
Not applicable

Is it possible to insert a family (Based on LocationCurve) at the same point and with the same LocationCurve from another?
Also based on LocationCurve

I get the FamilyInstance Line with FamilyInstance.GetReferences (FamilyInstanceReferenceType.WeakReference) .First
But then I don't recognize the reference to use it (It's Nothing) or the line with respect to another reference of the Reference Plane (Indicates that the line is not in the reference)

This would be the correct method:
Document.Create.NewFamilyInstance (reference, line, symbol)

How do I get the reference from the other family?
I already get the line with GetReferences. But I don't get the right reference.

 

 

 

0 Likes
807 Views
3 Replies
Replies (3)
Message 2 of 4

jeremytammik
Autodesk
Autodesk

I assume that you have verified that what you wish to achieve can be done manually through the end user interface, yes?

 

Maybe you can get a more useful reference from the element geometry using ComputeReferences = true?

 



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

0 Likes
Message 3 of 4

josealberto.torres
Contributor
Contributor
'I have tried to get the plane from the geometry (ComputeReferences = True) with GetFamilyReferenceByIndex And,
'get line from WeakReference and convert as line.
'if it refPlano is Nothing, get it from FamilyInstance.References (Not is Nothing):

Dim refPlane As Reference = utilesRevit.GetFamilyReferenceByIndex(oFO, 2)
If refPlane Is Nothing Then
refPlane = oFO.GetReferences(FamilyInstanceReferenceType.CenterFrontBack).FirstOrDefault
End If
Dim
 ref As Reference = oFO.GetReferences(FamilyInstanceReferenceType.WeakReference).First
Dim lin As Line = CType(oFO.Document.GetElement(ref).GetGeometryObjectFromReference(ref), Line)

' oFOS is The FamilySymbol load
Dim
oFF as FamilyInstanceevRevit.evAppUI.ActiveUIDocument.Document.Create.NewFamilyInstance(refPlane, lin ,oFOS)

' Error:
' {"Family cannot be placed on this line as it does not coincide with the input face." & vbCrLf & "Parameter name: multiple"}e.
 
 
Graitec - Spain
0 Likes
Message 4 of 4

josealberto.torres
Contributor
Contributor
oFO is FamilyInstance Original.
Graitec - Spain
0 Likes