<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Can't create Sweep from FamilySymbolProfile. in Revit API Forum</title>
    <link>https://forums.autodesk.com/t5/revit-api-forum/can-t-create-sweep-from-familysymbolprofile/m-p/9571817#M33728</link>
    <description>&lt;P&gt;Before you create the sweep programmatically, generate the model curves that you plan to use and perform the sweep generation manually in the end user interface. That will give you more precise information on any problems encountered:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://thebuildingcoder.typepad.com/blog/2009/07/debug-geometric-form-creation.html" target="_blank"&gt;http://thebuildingcoder.typepad.com/blog/2009/07/debug-geometric-form-creation.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 10 Jun 2020 12:46:36 GMT</pubDate>
    <dc:creator>jeremytammik</dc:creator>
    <dc:date>2020-06-10T12:46:36Z</dc:date>
    <item>
      <title>Can't create Sweep from FamilySymbolProfile.</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/can-t-create-sweep-from-familysymbolprofile/m-p/9571436#M33727</link>
      <description>&lt;P&gt;Hello All!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I try to create sweep with next code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt; '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()&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;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."&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Anybody help me?&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jun 2020 09:37:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/can-t-create-sweep-from-familysymbolprofile/m-p/9571436#M33727</guid>
      <dc:creator>AndrewButenko</dc:creator>
      <dc:date>2020-06-10T09:37:39Z</dc:date>
    </item>
    <item>
      <title>Re: Can't create Sweep from FamilySymbolProfile.</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/can-t-create-sweep-from-familysymbolprofile/m-p/9571817#M33728</link>
      <description>&lt;P&gt;Before you create the sweep programmatically, generate the model curves that you plan to use and perform the sweep generation manually in the end user interface. That will give you more precise information on any problems encountered:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://thebuildingcoder.typepad.com/blog/2009/07/debug-geometric-form-creation.html" target="_blank"&gt;http://thebuildingcoder.typepad.com/blog/2009/07/debug-geometric-form-creation.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jun 2020 12:46:36 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/can-t-create-sweep-from-familysymbolprofile/m-p/9571817#M33728</guid>
      <dc:creator>jeremytammik</dc:creator>
      <dc:date>2020-06-10T12:46:36Z</dc:date>
    </item>
    <item>
      <title>Re: Can't create Sweep from FamilySymbolProfile.</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/can-t-create-sweep-from-familysymbolprofile/m-p/9573709#M33729</link>
      <description>&lt;P&gt;You find the profile in a document (doc) and try to use it in another document (fdoc). That will not work. Copy the profile-family to the fdoc.&lt;/P&gt;</description>
      <pubDate>Thu, 11 Jun 2020 08:34:43 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/can-t-create-sweep-from-familysymbolprofile/m-p/9573709#M33729</guid>
      <dc:creator>FAIR59</dc:creator>
      <dc:date>2020-06-11T08:34:43Z</dc:date>
    </item>
    <item>
      <title>Re: Can't create Sweep from FamilySymbolProfile.</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/can-t-create-sweep-from-familysymbolprofile/m-p/9573744#M33730</link>
      <description>&lt;P&gt;I figure it.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Instead of using:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;sweep = fdoc.FamilyCreate.NewSweep (True, curves, sketchplane1, fsp, 0, ProfilePlaneLocation.Start)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;where fsp is FamilySymbolProfile,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I get profile geometry from a family document to a swp variable:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;Dim ffilter As ElementClassFilter = New ElementClassFilter (GetType (CurveElement))
Dim fcollector As FilteredElementCollector = New FilteredElementCollector (fdoc)
fcollector.WherePasses (ffilter)

Dim curves As List (Of DetailCurve) = fcollector.Cast (Of DetailCurve) .ToList

Dim caa As New CurveArrArray
Dim ca As New CurveArray

For Each c As Detail Curve In curves
ca.Append (c.GeometryCurve)
Next

caa.append (ca)

Dim swp As SweepProfile = doc.Application.Create.NewCurveLoopsProfile (caa)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and call:&lt;/P&gt;&lt;LI-CODE lang="general"&gt;sweep = fdoc.FamilyCreate.NewSweep (True, curves, sketchplane1, swp, 0, ProfilePlaneLocation.Start)&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 11 Jun 2020 08:55:56 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/can-t-create-sweep-from-familysymbolprofile/m-p/9573744#M33730</guid>
      <dc:creator>AndrewButenko</dc:creator>
      <dc:date>2020-06-11T08:55:56Z</dc:date>
    </item>
    <item>
      <title>Re: Can't create Sweep from FamilySymbolProfile.</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/can-t-create-sweep-from-familysymbolprofile/m-p/9591592#M33731</link>
      <description>&lt;P&gt;Thanks for posting your solution Andrew. All the examples I found for creating sweeps use a newly generated profile. All very well for simple examples, but not useful if you have an existing complex profile. Very much appreciated. Dale&lt;/P&gt;</description>
      <pubDate>Sun, 21 Jun 2020 06:16:00 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/can-t-create-sweep-from-familysymbolprofile/m-p/9591592#M33731</guid>
      <dc:creator>Dale.Bartlett</dc:creator>
      <dc:date>2020-06-21T06:16:00Z</dc:date>
    </item>
    <item>
      <title>Re: Can't create Sweep from FamilySymbolProfile.</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/can-t-create-sweep-from-familysymbolprofile/m-p/9591593#M33732</link>
      <description>&lt;P&gt;PS here is my C# conversion:&lt;/P&gt;&lt;LI-CODE lang="general"&gt;public static SweepProfile CreateSweepProfileFromProfile(RvtDoc pDoc)
{
ElementClassFilter ffilter = new ElementClassFilter(typeof(CurveElement));
FilteredElementCollector fcollector = new FilteredElementCollector(pDoc);
fcollector.WherePasses(ffilter);
List&amp;lt;DetailCurve&amp;gt; curves = fcollector.Cast&amp;lt;DetailCurve&amp;gt;().ToList();
CurveArrArray caa = new CurveArrArray();
CurveArray ca = new CurveArray();
foreach (DetailCurve c in curves)
ca.Append(c.GeometryCurve);
caa.Append(ca);
SweepProfile swp = pDoc.Application.Create.NewCurveLoopsProfile(caa);
// usage
// sweep = fdoc.FamilyCreate.NewSweep(true, curves, sketchplane1, swp, 0, ProfilePlaneLocation.Start);
return swp;
}&lt;/LI-CODE&gt;</description>
      <pubDate>Sun, 21 Jun 2020 06:18:02 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/can-t-create-sweep-from-familysymbolprofile/m-p/9591593#M33732</guid>
      <dc:creator>Dale.Bartlett</dc:creator>
      <dc:date>2020-06-21T06:18:02Z</dc:date>
    </item>
    <item>
      <title>Re: Can't create Sweep from FamilySymbolProfile.</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/can-t-create-sweep-from-familysymbolprofile/m-p/9591816#M33733</link>
      <description>&lt;P&gt;I've looked at your two answers several times over now and am still very confused by them.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The sweep creation requires a sweep path and a sweep profile.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The path is the second input argument, the profile the fourth.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You pass in `curves` as the second and `swp` as the fourth.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However, you also use `curves` to generate `swp`.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Isn't that awfully weird? Why are you using the sweep profile to define the sweep path, and vice versa?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Should not the path and the profile be two completely separate things?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Sorry if I am misunderstanding something completely...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you for any clarification!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is an example from The Building Coder samples that I understand better, by the way:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://github.com/jeremytammik/the_building_coder_samples/blob/master/BuildingCoder/BuildingCoder/CmdNewSweptBlend.cs#L25-L93" target="_blank"&gt;https://github.com/jeremytammik/the_building_coder_samples/blob/master/BuildingCoder/BuildingCoder/CmdNewSweptBlend.cs#L25-L93&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best regards,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Jeremy&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 21 Jun 2020 12:32:03 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/can-t-create-sweep-from-familysymbolprofile/m-p/9591816#M33733</guid>
      <dc:creator>jeremytammik</dc:creator>
      <dc:date>2020-06-21T12:32:03Z</dc:date>
    </item>
    <item>
      <title>Re: Can't create Sweep from FamilySymbolProfile.</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/can-t-create-sweep-from-familysymbolprofile/m-p/9591831#M33734</link>
      <description>&lt;P&gt;Taking another look at this, I not that this issue (or very similar ones) have been discussed repeatedly here in the past and the results summarised by The Building Coder, in case that is of any use:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://thebuildingcoder.typepad.com/blog/2018/02/newfamilysymbolprofile-sample-add-in.html" target="_blank"&gt;https://thebuildingcoder.typepad.com/blog/2018/02/newfamilysymbolprofile-sample-add-in.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 21 Jun 2020 12:37:40 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/can-t-create-sweep-from-familysymbolprofile/m-p/9591831#M33734</guid>
      <dc:creator>jeremytammik</dc:creator>
      <dc:date>2020-06-21T12:37:40Z</dc:date>
    </item>
  </channel>
</rss>

