Message 1 of 8
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello All!
I try to create sweep with next code:
'Get FamilySymbolProfile
Dim fsp As FamilySymbolProfile = GetSweepProfileFamily(doc, currentRetailingWallType.Profiles(0).Name)
'Get family Metric Generic Model path
Dim famTemplatePath As String = commandData.Application.Application.FamilyTemplatePath
famTemplatePath = famTemplatePath.Substring(0, famTemplatePath.LastIndexOf("\")) + "\Family Templates\English"
Dim pat As String = Path.Combine(famTemplatePath, "Metric Generic Model.rft")
'Get family document Metric Generic Model
Dim fdoc As Document = commandData.Application.Application.NewFamilyDocument(pat)
Dim sweep As Sweep = Nothing
Dim fTr As New Transaction(fdoc, "CreateSweep")
fTr.Start()
Dim plane As Plane = Plane.CreateByNormalAndOrigin(XYZ.BasisZ, New XYZ(0, 0, 0))
Dim sketchplane1 As SketchPlane = SketchPlane.Create(fdoc, plane)
Dim pnt4 As New XYZ(10, 0, 0)
Dim pnt5 As New XYZ(0, 10, 0)
Dim curve As Curve = Line.CreateBound(pnt4, pnt5)
Dim curves As New CurveArray()
curves.Append(curve)
' create a solid sweep
sweep = fdoc.FamilyCreate.NewSweep(True, curves, sketchplane1, fsp, 0, ProfilePlaneLocation.Start)
fTr.Commit()
But I get error: "Autodesk.Revit.Exceptions.ArgumentException: "One of the conditions for the inputs was not satisfied. Consult the documentation for requirements for each argument."
Anybody help me?
Solved! Go to Solution.