NullReference ''Object reference not set to an instance of an object''

NullReference ''Object reference not set to an instance of an object''

Anonymous
Not applicable
941 Views
1 Reply
Message 1 of 2

NullReference ''Object reference not set to an instance of an object''

Anonymous
Not applicable

Hi, I'm very new to programming with the api and started out with some Macros thats working as they should. But then i tried to do the same code in VS (C#) and i seem to get the error message NullReference and i really dont know what it means. It doesnt give me this exception in the Macros.. See image. Pls help 🙂

0 Likes
942 Views
1 Reply
Reply (1)
Message 2 of 2

jeremytammik
Autodesk
Autodesk

The first thing you need to do to learn programming efficiently is to search for existing answers on the Internet.

 

In the beginning, I can guarantee that you will not have a single question that has not already been answered many times over.

 

In this case, I would suggest searching for something like 'what does null reference mean?'

 

https://duckduckgo.com/?q=what+does+null+reference+mean

 

All the answers are already there!

 

To see the problem in your code, use the debugger and step through line by line.

 

To get started with the Revit API, work through the getting started material:

 

https://thebuildingcoder.typepad.com/blog/about-the-author.html#2

 

Much success, good luck and have fun programming.

 

Happy New Year!

  



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

0 Likes