<?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 Trouble creating wall in Revit API Forum</title>
    <link>https://forums.autodesk.com/t5/revit-api-forum/trouble-creating-wall/m-p/7484738#M55283</link>
    <description>&lt;P&gt;Hi everyone: I'm trying to make a simple add-in which creates a wall. It compile fine, but it doesn't works. What I'm doing wrong?&lt;/P&gt;&lt;P&gt;Here's the code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Highlight.cs&lt;/P&gt;&lt;PRE&gt;using System;
using System.Reflection;
using System.Collections.Generic;
using Autodesk.Revit.DB;
using Autodesk.Revit.UI;
using Autodesk.Revit.UI.Selection;
using System.Windows.Media.Imaging;
using System.Windows.Forms;
namespace Walkthrough
{
   /// &amp;lt;remarks&amp;gt;
   /// This application's main class. The class must be Public.
   /// &amp;lt;/remarks&amp;gt;
   public class Highlight : IExternalApplication
   {
      // Both OnStartup and OnShutdown must be implemented as public method
      public Result OnStartup(UIControlledApplication application)
      {
        	
      	
      	// Add a new ribbon panel
         RibbonPanel ribbonPanel = application.CreateRibbonPanel("NewRibbonPanel");

         // Create a push button to trigger a command add it to the ribbon panel.
         string thisAssemblyPath = Assembly.GetExecutingAssembly().Location;

        
         PushButtonData buttonData = new PushButtonData("cmdHelloWorld",
            "Hello World", thisAssemblyPath, "Walkthrough.HelloWorld");

         PushButton pushButton = ribbonPanel.AddItem(buttonData) as PushButton;

         
         
         
         // Optionally, other properties may be assigned to the button
         // a) tool-tip
         pushButton.ToolTip = "Say hello to the entire world.";

         // b) large bitmap
         Uri uriImage = new Uri(@"C:\globe.png");
         BitmapImage largeImage = new BitmapImage(uriImage);
         pushButton.LargeImage = largeImage;

         return Result.Succeeded;
      }

      public Result OnShutdown(UIControlledApplication application)
      {
         // nothing to clean up in this simple case
         return Result.Succeeded;
      }
   }
   /// &amp;lt;remarks&amp;gt;
   /// The "HelloWorld" external command. The class must be Public.
   /// &amp;lt;/remarks&amp;gt;
[Autodesk.Revit.Attributes.Transaction(Autodesk.Revit.Attributes.TransactionMode.Manual)]
   public class HelloWorld : IExternalCommand
   {
    
   	// The main Execute method (inherited from IExternalCommand) must be public
      public Autodesk.Revit.UI.Result Execute(ExternalCommandData revit,
          ref string message, ElementSet elements)
      {
   		Document doc = revit.Application.ActiveUIDocument.Document;
   		
   		Transaction trans = new Transaction(doc);
        trans.Start("CreationMurAuto");


       //Create line 
        XYZ start = new XYZ(0,0,0);
        XYZ end = new XYZ(100,100,0);
       
        Curve wallLine = Line.CreateBound(start, end);
        Level nivel = Level.Create(doc, 20.0);


		Wall.Create(doc, wallLine, nivel.Id, false);
        
        trans.Dispose();
        return Result.Succeeded;

      }
   }
}&lt;/PRE&gt;&lt;P&gt;Thank you&lt;/P&gt;</description>
    <pubDate>Mon, 23 Oct 2017 18:39:45 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2017-10-23T18:39:45Z</dc:date>
    <item>
      <title>Trouble creating wall</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/trouble-creating-wall/m-p/7484738#M55283</link>
      <description>&lt;P&gt;Hi everyone: I'm trying to make a simple add-in which creates a wall. It compile fine, but it doesn't works. What I'm doing wrong?&lt;/P&gt;&lt;P&gt;Here's the code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Highlight.cs&lt;/P&gt;&lt;PRE&gt;using System;
using System.Reflection;
using System.Collections.Generic;
using Autodesk.Revit.DB;
using Autodesk.Revit.UI;
using Autodesk.Revit.UI.Selection;
using System.Windows.Media.Imaging;
using System.Windows.Forms;
namespace Walkthrough
{
   /// &amp;lt;remarks&amp;gt;
   /// This application's main class. The class must be Public.
   /// &amp;lt;/remarks&amp;gt;
   public class Highlight : IExternalApplication
   {
      // Both OnStartup and OnShutdown must be implemented as public method
      public Result OnStartup(UIControlledApplication application)
      {
        	
      	
      	// Add a new ribbon panel
         RibbonPanel ribbonPanel = application.CreateRibbonPanel("NewRibbonPanel");

         // Create a push button to trigger a command add it to the ribbon panel.
         string thisAssemblyPath = Assembly.GetExecutingAssembly().Location;

        
         PushButtonData buttonData = new PushButtonData("cmdHelloWorld",
            "Hello World", thisAssemblyPath, "Walkthrough.HelloWorld");

         PushButton pushButton = ribbonPanel.AddItem(buttonData) as PushButton;

         
         
         
         // Optionally, other properties may be assigned to the button
         // a) tool-tip
         pushButton.ToolTip = "Say hello to the entire world.";

         // b) large bitmap
         Uri uriImage = new Uri(@"C:\globe.png");
         BitmapImage largeImage = new BitmapImage(uriImage);
         pushButton.LargeImage = largeImage;

         return Result.Succeeded;
      }

      public Result OnShutdown(UIControlledApplication application)
      {
         // nothing to clean up in this simple case
         return Result.Succeeded;
      }
   }
   /// &amp;lt;remarks&amp;gt;
   /// The "HelloWorld" external command. The class must be Public.
   /// &amp;lt;/remarks&amp;gt;
[Autodesk.Revit.Attributes.Transaction(Autodesk.Revit.Attributes.TransactionMode.Manual)]
   public class HelloWorld : IExternalCommand
   {
    
   	// The main Execute method (inherited from IExternalCommand) must be public
      public Autodesk.Revit.UI.Result Execute(ExternalCommandData revit,
          ref string message, ElementSet elements)
      {
   		Document doc = revit.Application.ActiveUIDocument.Document;
   		
   		Transaction trans = new Transaction(doc);
        trans.Start("CreationMurAuto");


       //Create line 
        XYZ start = new XYZ(0,0,0);
        XYZ end = new XYZ(100,100,0);
       
        Curve wallLine = Line.CreateBound(start, end);
        Level nivel = Level.Create(doc, 20.0);


		Wall.Create(doc, wallLine, nivel.Id, false);
        
        trans.Dispose();
        return Result.Succeeded;

      }
   }
}&lt;/PRE&gt;&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Mon, 23 Oct 2017 18:39:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/trouble-creating-wall/m-p/7484738#M55283</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-10-23T18:39:45Z</dc:date>
    </item>
    <item>
      <title>Re: Trouble creating wall</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/trouble-creating-wall/m-p/7485705#M55284</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;"trans.Commit()" is missing.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Revitalizer&lt;/P&gt;</description>
      <pubDate>Tue, 24 Oct 2017 03:45:56 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/trouble-creating-wall/m-p/7485705#M55284</guid>
      <dc:creator>Revitalizer</dc:creator>
      <dc:date>2017-10-24T03:45:56Z</dc:date>
    </item>
    <item>
      <title>Re: Trouble creating wall</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/trouble-creating-wall/m-p/7487159#M55285</link>
      <description>&lt;P&gt;It worked fine! Thanks a lot.&lt;/P&gt;</description>
      <pubDate>Tue, 24 Oct 2017 14:23:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/trouble-creating-wall/m-p/7487159#M55285</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-10-24T14:23:08Z</dc:date>
    </item>
  </channel>
</rss>

