<?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: How to create Z-offset Extrusion via API in Revit API Forum</title>
    <link>https://forums.autodesk.com/t5/revit-api-forum/how-to-create-z-offset-extrusion-via-api/m-p/9632063#M33098</link>
    <description>&lt;P&gt;Try putting your start Z values into the points in your profile.&lt;/P&gt;</description>
    <pubDate>Mon, 13 Jul 2020 12:09:30 GMT</pubDate>
    <dc:creator>RPTHOMAS108</dc:creator>
    <dc:date>2020-07-13T12:09:30Z</dc:date>
    <item>
      <title>How to create Z-offset Extrusion via API</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/how-to-create-z-offset-extrusion-via-api/m-p/9632033#M33097</link>
      <description>&lt;P&gt;Hi, kinds!&lt;/P&gt;&lt;P&gt;I wanna make a function for creating Extrusion easily like that:&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;Extrusion createExtrusionZ(CurveArrArray pProfile, double bottom, double height)
        {
            // mm to feet
            double bottomF = mmToFeet(bottom);
            double heightF = mmToFeet(height);

            // create Sketch Plane
            Plane pPlane = Plane.CreateByNormalAndOrigin(new XYZ(0.0,0.0,1.0),new XYZ(0.0,0.0,bottomF));
            SketchPlane pSketchPlane = SketchPlane.Create(_rvtDoc, pPlane) as SketchPlane;

            // return new Extrusion
            bool bIsSolid = true;
            return _rvtDoc.FamilyCreate.NewExtrusion(bIsSolid, pProfile, pSketchPlane, heightF);
        }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I expect that extrusion from [bottom] to [bottom + height] at Z direction, but I get that from [0] to [height] always.&lt;/P&gt;&lt;P&gt;I suspect that the way to create SketchPlane is mistaken, but I don't have any certain idea.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could you give me a hand, gentles?&lt;/P&gt;</description>
      <pubDate>Mon, 13 Jul 2020 11:55:59 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/how-to-create-z-offset-extrusion-via-api/m-p/9632033#M33097</guid>
      <dc:creator>YaGitHub</dc:creator>
      <dc:date>2020-07-13T11:55:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to create Z-offset Extrusion via API</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/how-to-create-z-offset-extrusion-via-api/m-p/9632063#M33098</link>
      <description>&lt;P&gt;Try putting your start Z values into the points in your profile.&lt;/P&gt;</description>
      <pubDate>Mon, 13 Jul 2020 12:09:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/how-to-create-z-offset-extrusion-via-api/m-p/9632063#M33098</guid>
      <dc:creator>RPTHOMAS108</dc:creator>
      <dc:date>2020-07-13T12:09:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to create Z-offset Extrusion via API</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/how-to-create-z-offset-extrusion-via-api/m-p/9638124#M33099</link>
      <description>&lt;P&gt;Thank you, Sir.&lt;/P&gt;&lt;P&gt;I could understand the specification of NewExtrusion-function.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But I wanna make a function as I posted. Therefore I did like below:&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt; Extrusion createExtrusionZ(CurveArrArray pProfile, double bottom, double height)
        {
            // mmToFeet
            double bottomF = mmToFeet(bottom);
            double heightF = mmToFeet(height);

            // make sketch plane
            Plane pPlane = Plane.CreateByNormalAndOrigin(new XYZ(0.0,0.0,1.0),new XYZ(0.0,0.0,0.0));
            SketchPlane pSketchPlane = SketchPlane.Create(_rvtDoc, pPlane) as SketchPlane;

            // make Extrusion
            bool bIsSolid = true;
            Extrusion newExtrusion = _rvtDoc.FamilyCreate.NewExtrusion(bIsSolid, pProfile, pSketchPlane, heightF);

            // move Extrusion
            XYZ transPoint = new XYZ(0.0, 0.0, bottomF);
            ElementTransformUtils.MoveElement(_rvtDoc, newExtrusion.Id, transPoint);
            return newExtrusion;
        }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Step 1 : Make new Extrusion attached to Z=0&lt;/P&gt;&lt;P&gt;Step 2 : Move the Extrusion to expected Z&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;🧐&lt;/P&gt;</description>
      <pubDate>Thu, 16 Jul 2020 02:46:33 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/how-to-create-z-offset-extrusion-via-api/m-p/9638124#M33099</guid>
      <dc:creator>YaGitHub</dc:creator>
      <dc:date>2020-07-16T02:46:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to create Z-offset Extrusion via API</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/how-to-create-z-offset-extrusion-via-api/m-p/9640133#M33100</link>
      <description>&lt;P&gt;Intuitively it would seem that the plane would set the z value as you had it but apparently not.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I don't know if there is a better option than moving the item after creation to enable you to have the same form of function. Curves in the profile can be iterated and transformed to new Z but I don't know if that would be advantageous or not.&lt;/P&gt;</description>
      <pubDate>Thu, 16 Jul 2020 22:43:47 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/how-to-create-z-offset-extrusion-via-api/m-p/9640133#M33100</guid>
      <dc:creator>RPTHOMAS108</dc:creator>
      <dc:date>2020-07-16T22:43:47Z</dc:date>
    </item>
  </channel>
</rss>

