<?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: [bug] SetFaceOffset Face doesn't belong to the Part in Revit API Forum</title>
    <link>https://forums.autodesk.com/t5/revit-api-forum/bug-setfaceoffset-face-doesn-t-belong-to-the-part/m-p/10444752#M25415</link>
    <description>&lt;P&gt;Macro function needs to a have void return type to be listed in the macro manager to run.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Anyway I find it works when I made that change and pick a face in the 3D view.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I see cast to part is being done so know part is being selected.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The RevitAPI.chm notes the wording under ArgumentException:&lt;/P&gt;&lt;P&gt;&lt;EM&gt;"face does not belong to the part. -or- The face to be offset should be planar and satisfy constraints of its parent element"&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also is the function Part.CanOffsetFace working as expected? i.e. if you get the error after checking this then something is wrong there perhaps.&lt;/P&gt;</description>
    <pubDate>Mon, 05 Jul 2021 17:11:57 GMT</pubDate>
    <dc:creator>RPTHOMAS108</dc:creator>
    <dc:date>2021-07-05T17:11:57Z</dc:date>
    <item>
      <title>[bug] SetFaceOffset Face doesn't belong to the Part</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/bug-setfaceoffset-face-doesn-t-belong-to-the-part/m-p/10388602#M25407</link>
      <description>&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;I was trying to edit the shape of a Part using the method SetFaceOffset. I get the sample from &lt;A href="https://thebuildingcoder.typepad.com/blog/2012/09/parts-assemblies-partutils-and-divideparts.html" target="_blank"&gt;https://thebuildingcoder.typepad.com/blog/2012/09/parts-assemblies-partutils-and-divideparts.html&lt;/A&gt;&lt;BR /&gt;However I'm always having an error saying "face doesn't belong to the part". Which I think is impossible. My code so far :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;UIDocument uidoc = uiapp.ActiveUIDocument;
Autodesk.Revit.ApplicationServices.Application app = uiapp.Application;
Document doc = uidoc.Document;

Reference refS = uidoc.Selection.PickObject(ObjectType.Element);
Part p = doc.GetElement(refS.ElementId) as Part;
Options opt = new Options();
opt.View = doc.ActiveView;
GeometryElement geomElem = p.get_Geometry(opt);
foreach (GeometryObject geomObject in geomElem)
{
    if (geomObject is Solid)
    {
        Solid solid = geomObject as Solid;
        FaceArray faceArray = solid.Faces;
        foreach (Face face in faceArray)
        {
            if (p.CanOffsetFace(face))
            {
                p.SetFaceOffset(face, 0.078740157480311268);
            }
        }
    }
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Have you got any ideas why I get this error ? Is it a bug of the Revit API ?&lt;BR /&gt;Thanks !&lt;/P&gt;</description>
      <pubDate>Mon, 14 Jun 2021 12:31:14 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/bug-setfaceoffset-face-doesn-t-belong-to-the-part/m-p/10388602#M25407</guid>
      <dc:creator>maxime.touchard7RAK6</dc:creator>
      <dc:date>2021-06-14T12:31:14Z</dc:date>
    </item>
    <item>
      <title>Re: [bug] SetFaceOffset Face doesn't belong to the Part</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/bug-setfaceoffset-face-doesn-t-belong-to-the-part/m-p/10388647#M25408</link>
      <description>&lt;P&gt;In the sample you refer to, the element is a multi-layer compound structure wall, and all the faces being offset seem to be parallel to each other and to the wall location line. Maybe some of these restrictions are relevant in your case too, and maybe violated in some way. Can you achieve the desired effect manually through the end user interface? Then it should be possible programmatically as well. If it works in the UI and fails in the API, please submit a minimal reproducible case that I can pass on to the development team:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://thebuildingcoder.typepad.com/blog/about-the-author.html#1b" target="_blank"&gt;https://thebuildingcoder.typepad.com/blog/about-the-author.html#1b&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 14 Jun 2021 12:51:03 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/bug-setfaceoffset-face-doesn-t-belong-to-the-part/m-p/10388647#M25408</guid>
      <dc:creator>jeremy_tammik</dc:creator>
      <dc:date>2021-06-14T12:51:03Z</dc:date>
    </item>
    <item>
      <title>Re: [bug] SetFaceOffset Face doesn't belong to the Part</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/bug-setfaceoffset-face-doesn-t-belong-to-the-part/m-p/10388949#M25409</link>
      <description>&lt;P&gt;Hi Jeremy,&lt;/P&gt;&lt;P&gt;Thank you for your quick reply.&lt;/P&gt;&lt;P&gt;As you can see in the attacted image, the part seems to to respect all the conditions. I tried the same sample on a Generic wall and I get the same issue... I'm starting to doubt &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;BR /&gt;To reproduce the problem :&lt;BR /&gt;I'm using Revit 2021.1.3&lt;BR /&gt;Steps :&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; -Create new project&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; -Create one wall (Generic 200mm)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; -Go to "Create tab"&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; -Click "Create Parts"&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; -Execute the previous sample on the recently created Part&lt;BR /&gt;&lt;BR /&gt;Thank you for your help&lt;/P&gt;</description>
      <pubDate>Mon, 14 Jun 2021 14:47:34 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/bug-setfaceoffset-face-doesn-t-belong-to-the-part/m-p/10388949#M25409</guid>
      <dc:creator>maxime.touchard7RAK6</dc:creator>
      <dc:date>2021-06-14T14:47:34Z</dc:date>
    </item>
    <item>
      <title>Re: [bug] SetFaceOffset Face doesn't belong to the Part</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/bug-setfaceoffset-face-doesn-t-belong-to-the-part/m-p/10400765#M25410</link>
      <description>&lt;P&gt;Does the same operation work as you expect when you drive it manually through the end user interface?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please check that first.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Secondly, please submit a complete minimal reproducible case for this, including your complete macro or add-in solution and a minimal model to test it in, just in case there is something special in the somewhere that we might otherwise miss.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://thebuildingcoder.typepad.com/blog/about-the-author.html#1b" target="_blank"&gt;https://thebuildingcoder.typepad.com/blog/about-the-author.html#1b&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 18 Jun 2021 09:30:59 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/bug-setfaceoffset-face-doesn-t-belong-to-the-part/m-p/10400765#M25410</guid>
      <dc:creator>jeremy_tammik</dc:creator>
      <dc:date>2021-06-18T09:30:59Z</dc:date>
    </item>
    <item>
      <title>Re: [bug] SetFaceOffset Face doesn't belong to the Part</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/bug-setfaceoffset-face-doesn-t-belong-to-the-part/m-p/10414318#M25411</link>
      <description>&lt;P&gt;Hi Jeremy,&lt;BR /&gt;Yes it works in the UI.&lt;BR /&gt;Here is a minimum test file. The wall in the file in one big part which can be edited by the UI using the shape handles. But while trying to edit the part with SetFaceOffset() it always fail.&lt;/P&gt;&lt;P&gt;My code:&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;#region Namespaces
using Autodesk.Revit.Attributes;
using Autodesk.Revit.DB;
using Autodesk.Revit.UI;
using Autodesk.Revit.UI.Selection;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows;

#endregion

namespace SameTypeJunctionLayers
{
    [Transaction(TransactionMode.Manual)]
    public class Command : IExternalCommand
    {
        public Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
        {
            UIApplication uiapp = commandData.Application;
            UIDocument uidoc = uiapp.ActiveUIDocument;
            Autodesk.Revit.ApplicationServices.Application app = uiapp.Application;
            Document doc = uidoc.Document;

            Reference refS = uidoc.Selection.PickObject(ObjectType.Element);
            Part p = doc.GetElement(refS.ElementId) as Part;
            Options opt = new Options();
            opt.View = doc.ActiveView;
            opt.ComputeReferences = true;
            GeometryElement geomElem = p.get_Geometry(opt);

            using (Transaction tr = new Transaction(doc, "edit part"))
            {
                tr.Start();
                foreach (GeometryObject geomObject in geomElem)
                {
                    if (geomObject is Solid)
                    {
                        Solid solid = geomObject as Solid;
                        FaceArray faceArray = solid.Faces;
                        foreach (Face face in faceArray)
                        {
                            if (p.CanOffsetFace(face))
                            {
                                try
                                {
                                    p.SetFaceOffset(face, 0.1);
                                    MessageBox.Show("offseted");
                                }
                                catch
                                {
                                    MessageBox.Show("notOffsetd");
                                }
                            }
                            else
                            {
                                MessageBox.Show("cantbeOffseted");
                            }
                        }
                    }
                }
                tr.Commit();
            }
            return Result.Succeeded;
        }
    }
}&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 23 Jun 2021 12:50:26 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/bug-setfaceoffset-face-doesn-t-belong-to-the-part/m-p/10414318#M25411</guid>
      <dc:creator>maxime.touchard7RAK6</dc:creator>
      <dc:date>2021-06-23T12:50:26Z</dc:date>
    </item>
    <item>
      <title>Re: [bug] SetFaceOffset Face doesn't belong to the Part</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/bug-setfaceoffset-face-doesn-t-belong-to-the-part/m-p/10414478#M25412</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Dear Maxime,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Thank you for your report, clear description and sample material.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Sorry to hear about this.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I logged the issue &lt;U&gt;&lt;STRONG&gt;REVIT-178837&lt;/STRONG&gt;&lt;/U&gt; [SetFaceOffset Face doesn't belong to the Part] with our development team for this on your behalf as it requires further exploration and possibly a modification to our software. Please make a note of this number for future reference.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;You are welcome to request an update on the status of this issue or to provide additional information on it at any time quoting this change request number.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;This issue is important to me. What can I do to help?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;This issue needs to be assessed by our engineering team and prioritised against all other outstanding change requests. Any information that you can provide to influence this assessment will help. Please provide the following where possible:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;SPAN&gt;Impact on your application and/or your development.&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;SPAN&gt;The number of users affected.&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;SPAN&gt;The potential revenue impact to you.&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;SPAN&gt;The potential revenue impact to Autodesk.&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;SPAN&gt;Realistic timescale over which a fix would help you.&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;SPAN&gt;In the case of a request for a new feature or a feature enhancement, please also provide detailed Use cases for the workflows that this change would address.&lt;/SPAN&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;This information is extremely important. Our engineering team have limited resources, and so must focus their efforts on the highest impact items. We do understand that this will cause you delays and affect your development planning, and we appreciate your cooperation and patience.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I hope this helps.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Best regards,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Jeremy&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Jun 2021 13:34:31 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/bug-setfaceoffset-face-doesn-t-belong-to-the-part/m-p/10414478#M25412</guid>
      <dc:creator>jeremy_tammik</dc:creator>
      <dc:date>2021-06-23T13:34:31Z</dc:date>
    </item>
    <item>
      <title>Re: [bug] SetFaceOffset Face doesn't belong to the Part</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/bug-setfaceoffset-face-doesn-t-belong-to-the-part/m-p/10434899#M25413</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Dear Maxime,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;The development team analysed the issue &lt;U&gt;&lt;STRONG&gt;REVIT-178837&lt;/STRONG&gt;&lt;/U&gt; [SetFaceOffset Face doesn't belong to the Part] and reply:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I implemented the attached Revit macro JWMTestRevitMacro.txt also listed below that's almost identical to the one provided by the add-in developer.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;It works as expected in my internal development build.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Does it fix the problem for Maxime as well?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;What is the actual error message?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;"face doesn't belong to the part" is not a real error message, as far as I can tell.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I found the exception "face does not belong to the part." in Revit's Part code.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;However, as said, I did not encounter any errors or exceptions running my attached macro code.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Please test it your end as well and let us know how it goes.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Thank you!&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Best regards,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Jeremy&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;LI-CODE lang="general"&gt;/*
 * Created by SharpDevelop.
 * User: mitchej
 * Date: 6/25/2021
 * Time: 11:06 AM
 * 
 * To change this template use Tools | Options | Coding | Edit Standard Headers.
 */
using System;
using Autodesk.Revit.Attributes;
using Autodesk.Revit.UI;
using Autodesk.Revit.DB;
using Autodesk.Revit.UI.Selection;
using System.Collections.Generic;
using System.Linq;
using System.Windows;

namespace JWMTest
{
  [Autodesk.Revit.Attributes.Transaction(Autodesk.Revit.Attributes.TransactionMode.Manual)]
  [Autodesk.Revit.DB.Macros.AddInId("408FA176-F788-4C86-B988-6AD65804DD9E")]
  public partial class ThisDocument
  {
    private void Module_Startup(object sender, EventArgs e)
    {
    }

    private void Module_Shutdown(object sender, EventArgs e)
    {
    }

    #region Revit Macros generated code
    private void InternalStartup()
    {
      this.Startup += new System.EventHandler(Module_Startup);
      this.Shutdown += new System.EventHandler(Module_Shutdown);
    }
    #endregion
    
    public Result JWMTestMacro()
    {
      Document doc = this.Document;
      Reference refS = this.Selection.PickObject(ObjectType.Element);
      Part p = doc.GetElement(refS.ElementId) as Part;
      Options opt = new Options();
      opt.View = doc.ActiveView;
      opt.ComputeReferences = true;
      GeometryElement geomElem = p.get_Geometry(opt);

      using (Transaction tr = new Transaction(doc, "edit part"))
      {
        tr.Start();
        foreach (GeometryObject geomObject in geomElem)
        {
            if (geomObject is Solid)
            {
              Solid solid = geomObject as Solid;
              FaceArray faceArray = solid.Faces;
              foreach (Face face in faceArray)
              {
                  if (p.CanOffsetFace(face))
                  {
                    try
                    {
                        p.SetFaceOffset(face, 0.1);
                        //MessageBox.Show("offseted");
                    }
                    catch
                    {
                        //MessageBox.Show("notOffsetd");
                    }
                  }
                  else
                  {
                    //MessageBox.Show("cantbeOffseted");
                  }
              }
            }
        }
        tr.Commit();
      }      
      return Result.Succeeded;
    }
  }
}&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Jul 2021 08:59:41 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/bug-setfaceoffset-face-doesn-t-belong-to-the-part/m-p/10434899#M25413</guid>
      <dc:creator>jeremy_tammik</dc:creator>
      <dc:date>2021-07-01T08:59:41Z</dc:date>
    </item>
    <item>
      <title>Re: [bug] SetFaceOffset Face doesn't belong to the Part</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/bug-setfaceoffset-face-doesn-t-belong-to-the-part/m-p/10443729#M25414</link>
      <description>&lt;P&gt;Is the issue resolved for you now?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Jul 2021 09:31:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/bug-setfaceoffset-face-doesn-t-belong-to-the-part/m-p/10443729#M25414</guid>
      <dc:creator>jeremy_tammik</dc:creator>
      <dc:date>2021-07-05T09:31:52Z</dc:date>
    </item>
    <item>
      <title>Re: [bug] SetFaceOffset Face doesn't belong to the Part</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/bug-setfaceoffset-face-doesn-t-belong-to-the-part/m-p/10444752#M25415</link>
      <description>&lt;P&gt;Macro function needs to a have void return type to be listed in the macro manager to run.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Anyway I find it works when I made that change and pick a face in the 3D view.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I see cast to part is being done so know part is being selected.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The RevitAPI.chm notes the wording under ArgumentException:&lt;/P&gt;&lt;P&gt;&lt;EM&gt;"face does not belong to the part. -or- The face to be offset should be planar and satisfy constraints of its parent element"&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also is the function Part.CanOffsetFace working as expected? i.e. if you get the error after checking this then something is wrong there perhaps.&lt;/P&gt;</description>
      <pubDate>Mon, 05 Jul 2021 17:11:57 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/bug-setfaceoffset-face-doesn-t-belong-to-the-part/m-p/10444752#M25415</guid>
      <dc:creator>RPTHOMAS108</dc:creator>
      <dc:date>2021-07-05T17:11:57Z</dc:date>
    </item>
    <item>
      <title>Re: [bug] SetFaceOffset Face doesn't belong to the Part</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/bug-setfaceoffset-face-doesn-t-belong-to-the-part/m-p/10445951#M25416</link>
      <description>&lt;P&gt;Hi everyone,&lt;BR /&gt;Thanks a lot !&lt;BR /&gt;I do have a good news and a bad news.&lt;BR /&gt;Unfortunatly your sample doesn't resolve my problem. I don't know why.. Could it comes from my version of the software (2021.1.3) ? Something else ?&lt;BR /&gt;The good news now : I found a workaround. So for anyone having the problem here is the sample that is worked for me :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;public static Result test(Document doc, UIDocument uidoc)
{
    Reference refS = uidoc.Selection.PickObject(ObjectType.Element);
    Part p = doc.GetElement(refS.ElementId) as Part;
    Options opt = new Options();
    opt.View = doc.ActiveView;
    opt.ComputeReferences = true;
    GeometryElement geomElem = p.get_Geometry(opt);
    using (Transaction tr = new Transaction(doc, "edit part"))
    {
        tr.Start();
        foreach (GeometryObject geomObject in geomElem)
        {
            if (geomObject is Solid)
            {
                Solid solid = geomObject as Solid;
                FaceArray faceArray = solid.Faces;
                foreach (Face face in faceArray)
                {
                    PlanarFace refFace = p.GetGeometryObjectFromReference(face.Reference) as PlanarFace;
                    if (refFace == null)
                    {
                        continue;
                    }
                    if (p.CanOffsetFace(refFace))
                    {
                        try
                        {
                            p.SetFaceOffset(refFace, 0.1);
                            // MessageBox.Show("offseted");
                        }
                        catch(Exception exp)
                        {
                            MessageBox.Show("notOffsetd " + exp.Message);
                        }
                    }
                    else
                    {
                        //MessageBox.Show("cantbeOffseted");
                    }
                }
            }
        }
        tr.Commit();
    }
    return Result.Succeeded;
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As you can see I have to get the face with GetGeometryObjectFromReference() so the function SetFaceOffset() recognize the that the Face belongs to the Part.&lt;/P&gt;</description>
      <pubDate>Tue, 06 Jul 2021 07:32:57 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/bug-setfaceoffset-face-doesn-t-belong-to-the-part/m-p/10445951#M25416</guid>
      <dc:creator>maxime.touchard7RAK6</dc:creator>
      <dc:date>2021-07-06T07:32:57Z</dc:date>
    </item>
    <item>
      <title>Re: [bug] SetFaceOffset Face doesn't belong to the Part</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/bug-setfaceoffset-face-doesn-t-belong-to-the-part/m-p/10446245#M25417</link>
      <description>&lt;P&gt;Congratulations on solving and thank you very much for letting us know how!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Jul 2021 09:28:29 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/bug-setfaceoffset-face-doesn-t-belong-to-the-part/m-p/10446245#M25417</guid>
      <dc:creator>jeremy_tammik</dc:creator>
      <dc:date>2021-07-06T09:28:29Z</dc:date>
    </item>
  </channel>
</rss>

