I have a problem with creating NewSweptBlendForm, the issue prabably is with ReferenceArrayArray. I dont understand why cant I just pass CurveLoop, why it have to be a reference. The code looks like this:
//Some code before
FamilyInstance baseFamilyInstance = (FamilyInstance)keyValuePairs["BaseFamilyInstance"];
FamilyInstance negativeFamilyInstance = (FamilyInstance)keyValuePairs["NegativeFamilyInstance"];
ModelLine negBaseLine = CreateModelLine(negativeSectionPointArray, baseSectionPointArray);
using(Transaction transaction = new Transaction(document,"Create swept blend"))
{
transaction.Start();
ReferenceArray lineReferenceArray = new ReferenceArray();
lineReferenceArray.Append(negBaseLine.GeometryCurve.Reference);
Options options = new Options();
options.ComputeReferences = true;
options.IncludeNonVisibleObjects = true;
options.DetailLevel = ViewDetailLevel.Fine;
CurveLoop baseCurve = CurveLoop.Create(baseFamilyInstance.get_Geometry(options).OfType<Curve>().ToList());
CurveLoop negativeCurve = CurveLoop.Create(negativeFamilyInstance.get_Geometry(options).OfType<Curve>().ToList());
ReferenceArray baseSectionReference = new ReferenceArray();
ReferenceArray negativeSectionReference = new ReferenceArray();
foreach(Curve c in baseCurve)
{
baseSectionReference.Append(c.Reference);
}
foreach(Curve c in negativeCurve)
{
negativeSectionReference.Append(c.Reference);
}
ReferenceArrayArray referenceArrayArray = new ReferenceArrayArray();
referenceArrayArray.Append(baseSectionReference);
referenceArrayArray.Append(negativeSectionReference);
document.FamilyCreate.NewSweptBlendForm(true, lineReferenceArray, referenceArrayArray);
transaction.Commit();
}
I use this as node in dynamo, and the outpout is: cannot create swept bledn form. What am I doing wrong?