none
Please Help Me 1. Error CS1010: Newline in constant , 2 .Error CS1513: } expected RRS feed

  • Question

  •    /// <remarks> 

       /// The "(HelloWorld)" external command. The class must be Public. 

       /// </remarks>

      

       [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) 

          { 

             TaskDialog.Show("Revit""Hello World"); 

             return Autodesk.Revit.UI.Result.Succeeded; 

          } 

       } 



       

       }

        

        }
    Monday, August 27, 2018 10:35 AM

All replies

  • The "Newline in constant" error usually means that somewhere in the code you start a string by opening quotes and then fail to close the quotes. Normally the error doesn't happen in the place where you forgot to close the quotes, but several lines below wherever you start a new string constant and the compiler "sees" a new pair of quotes.

    Since there are no unpaired quotes in the block of code that you posted, the suspicion is that the unclosed string might occur earlier in your code, somewhere among the lines that are written above the fragment that you posted.

    Monday, August 27, 2018 12:59 PM
    Moderator
  • Hi mohan,

    Could you please share a simple demo which could reproduce the issue via OneDrive. 

    In addition, based on your code, it seems that the issue is more related to 3rd-party component, you could also post your issue on 3rd-party forum for suitable support.

    https://forums.autodesk.com/t5/net/bd-p/152

    Best regards,

    Zhanglong


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Tuesday, August 28, 2018 2:59 AM
    Moderator