<?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 Setting Center(Front / Back) work plane for an extrusion in Revit API Forum</title>
    <link>https://forums.autodesk.com/t5/revit-api-forum/setting-center-front-back-work-plane-for-an-extrusion/m-p/10066762#M28370</link>
    <description>&lt;P&gt;Hello,&lt;BR /&gt;I am creating a profile and extrusion.While creating it I am paasing the sketch plane as below :&lt;BR /&gt;&lt;BR /&gt;SketchPlane sketch = FindElement(doc,&lt;BR /&gt;typeof(SketchPlane), "Ref. Level")&lt;BR /&gt;as SketchPlane;&lt;/P&gt;&lt;P&gt;I want to assign Reference Plane : Center(Front / Back) to the extrusion.&lt;BR /&gt;If I pass this reference plane as :&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;ReferencePlane refpl = null;&lt;BR /&gt;FilteredElementCollector collecctor = new FilteredElementCollector(doc).OfClass(typeof(ReferencePlane)).WhereElementIsNotElementType();&lt;BR /&gt;foreach (ReferencePlane p in collecctor)&lt;BR /&gt;{&lt;BR /&gt;if (p.Name == "Center (Front/Back)")&lt;BR /&gt;{&lt;BR /&gt;refpl = p as ReferencePlane;&lt;BR /&gt;break;&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;SketchPlane sketch = SketchPlane.Create(doc, refpl.Id);&lt;/P&gt;&lt;P&gt;doc.FamilyCreate.NewExtrusion(true, curveArrArray, sketch, extrusionHeight);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am getting exception while calling NewExtrusion() method as "One of the conditions for the inputs was not satisfied. Consult the documentation for requirements for each argument."&lt;BR /&gt;&lt;BR /&gt;How can I set&amp;nbsp;Reference Plane : Center(Front / Back) as work plane for the extrusion?&lt;/P&gt;</description>
    <pubDate>Mon, 08 Feb 2021 15:16:16 GMT</pubDate>
    <dc:creator>shweta.deshpande</dc:creator>
    <dc:date>2021-02-08T15:16:16Z</dc:date>
    <item>
      <title>Setting Center(Front / Back) work plane for an extrusion</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/setting-center-front-back-work-plane-for-an-extrusion/m-p/10066762#M28370</link>
      <description>&lt;P&gt;Hello,&lt;BR /&gt;I am creating a profile and extrusion.While creating it I am paasing the sketch plane as below :&lt;BR /&gt;&lt;BR /&gt;SketchPlane sketch = FindElement(doc,&lt;BR /&gt;typeof(SketchPlane), "Ref. Level")&lt;BR /&gt;as SketchPlane;&lt;/P&gt;&lt;P&gt;I want to assign Reference Plane : Center(Front / Back) to the extrusion.&lt;BR /&gt;If I pass this reference plane as :&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;ReferencePlane refpl = null;&lt;BR /&gt;FilteredElementCollector collecctor = new FilteredElementCollector(doc).OfClass(typeof(ReferencePlane)).WhereElementIsNotElementType();&lt;BR /&gt;foreach (ReferencePlane p in collecctor)&lt;BR /&gt;{&lt;BR /&gt;if (p.Name == "Center (Front/Back)")&lt;BR /&gt;{&lt;BR /&gt;refpl = p as ReferencePlane;&lt;BR /&gt;break;&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;SketchPlane sketch = SketchPlane.Create(doc, refpl.Id);&lt;/P&gt;&lt;P&gt;doc.FamilyCreate.NewExtrusion(true, curveArrArray, sketch, extrusionHeight);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am getting exception while calling NewExtrusion() method as "One of the conditions for the inputs was not satisfied. Consult the documentation for requirements for each argument."&lt;BR /&gt;&lt;BR /&gt;How can I set&amp;nbsp;Reference Plane : Center(Front / Back) as work plane for the extrusion?&lt;/P&gt;</description>
      <pubDate>Mon, 08 Feb 2021 15:16:16 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/setting-center-front-back-work-plane-for-an-extrusion/m-p/10066762#M28370</guid>
      <dc:creator>shweta.deshpande</dc:creator>
      <dc:date>2021-02-08T15:16:16Z</dc:date>
    </item>
    <item>
      <title>Re: Setting Center(Front / Back) work plane for an extrusion</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/setting-center-front-back-work-plane-for-an-extrusion/m-p/10068146#M28371</link>
      <description>&lt;P&gt;You don't really set the work plane. How is your curve array array formed should be in X-Z plane for centre front back.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;Private Function TObj155(ByVal commandData As Autodesk.Revit.UI.ExternalCommandData,
ByRef message As String, ByVal elements As Autodesk.Revit.DB.ElementSet) As Result
        Dim UIDoc As UIDocument = commandData.Application.ActiveUIDocument
        If UIDoc Is Nothing Then Return Result.Cancelled Else
        Dim IntDoc As Document = UIDoc.Document

        Dim TR As XYZ = (XYZ.BasisX + XYZ.BasisZ) * 0.5
        Dim TL As XYZ = (-XYZ.BasisX + XYZ.BasisZ) * 0.5
        Dim BL As XYZ = (-XYZ.BasisX - XYZ.BasisZ) * 0.5
        Dim BR As XYZ = (XYZ.BasisX - XYZ.BasisZ) * 0.5

        Dim LN_Top As Line = Line.CreateBound(TR, TL)
        Dim LN_Left As Line = Line.CreateBound(TL, BL)
        Dim LN_Btm As Line = Line.CreateBound(BL, BR)
        Dim LN_Right As Line = Line.CreateBound(BR, TR)

        Dim Ca As Curve() = New Curve(3) {LN_Top, LN_Left, LN_Btm, LN_Right}
        Dim CAr As New CurveArray
        For I = 0 To Ca.Length - 1
            CAr.Append(Ca(I))
        Next
        Dim CArAr As New CurveArrArray
        CArAr.Append(CAr)

        Dim FEC As New FilteredElementCollector(IntDoc)
        Dim ECF As New ElementClassFilter(GetType(ReferencePlane))
        Dim Els As List(Of Element) = FEC.WherePasses(ECF).ToElements.Where(Function(x) x.Name = "Center (Front/Back)").ToList

        If Els.Count = 0 Then
            Return Result.Cancelled
        End If

        Using Tx As New Transaction(IntDoc, "Extrude")
            If Tx.Start = TransactionStatus.Started Then
                Dim SKP As SketchPlane = SketchPlane.Create(IntDoc, Els(0).Id)
                IntDoc.FamilyCreate.NewExtrusion(True, CArAr, SKP, 1)

                Tx.Commit()
            End If
        End Using

        Return Result.Succeeded

    End Function&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 09 Feb 2021 00:48:13 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/setting-center-front-back-work-plane-for-an-extrusion/m-p/10068146#M28371</guid>
      <dc:creator>RPTHOMAS108</dc:creator>
      <dc:date>2021-02-09T00:48:13Z</dc:date>
    </item>
    <item>
      <title>Re: Setting Center(Front / Back) work plane for an extrusion</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/setting-center-front-back-work-plane-for-an-extrusion/m-p/10068563#M28372</link>
      <description>&lt;P&gt;Thanks for the response.&lt;BR /&gt;&lt;BR /&gt;Actually points for the curve are coming in X-Y plane.&lt;BR /&gt;Looking at your code, I tried passing Y points to Z coordinate and issue is resolved.&lt;BR /&gt;Still not sure whether what I did is correct but now the profile is coming as expected.&lt;/P&gt;</description>
      <pubDate>Tue, 09 Feb 2021 05:38:59 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/setting-center-front-back-work-plane-for-an-extrusion/m-p/10068563#M28372</guid>
      <dc:creator>shweta.deshpande</dc:creator>
      <dc:date>2021-02-09T05:38:59Z</dc:date>
    </item>
    <item>
      <title>Re: Setting Center(Front / Back) work plane for an extrusion</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/setting-center-front-back-work-plane-for-an-extrusion/m-p/10069106#M28373</link>
      <description>&lt;P&gt;You need to go by the view cube: the reference plane 'centre front / back' is in the X-Z plane, 'centre left /right' is in the Y-Z plane, the level ref is X-Y (top / bottom) etc.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you were sketching the extrusion sketch in the UI which direction would it be in, that is what you have to consider.&lt;/P&gt;</description>
      <pubDate>Tue, 09 Feb 2021 10:39:42 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/setting-center-front-back-work-plane-for-an-extrusion/m-p/10069106#M28373</guid>
      <dc:creator>RPTHOMAS108</dc:creator>
      <dc:date>2021-02-09T10:39:42Z</dc:date>
    </item>
  </channel>
</rss>

