Active Member
Posts: 7
Registered: ‎02-28-2006
Message 1 of 1 (58 Views)

how get an entity from autocad to .Net Form

58 Views, 0 Replies
03-02-2006 01:14 AM

In .net form i had button
on button click i call this method " LineLength".

But at this line it is giving error
The error is "Object refernec not set to an instantiate an object:
and null refernce exception is occured".

But when we are using NETLOAD this is working fine.
When I click the button this is getting error.

Not reconizing any classes Like Editor and DataBase and gives the error.
what should i do for rectifying the problem.

Dim ed As Editor = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocum
Here it is not recognizing any class like editor, dataBase

using System;
using System.Windows.Forms;
using Autodesk.AutoCAD.Interop;
import Autodesk.AutoCAD.Interop.Common;
import acadApp = Autodesk.AutoCAD.ApplicationServices.Application;
import System.Runtime.InteropServices;
import Autodesk.AutoCAD.Runtime;
import Autodesk.AutoCAD.Geometry;
import Autodesk.AutoCAD.EditorInput;
import Autodesk.AutoCAD.DatabaseServices;

Public Shared Sub LineLength()

Dim ed As Editor = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocum ent.Editor
Dim db As Database = HostApplicationServices.WorkingDatabase
Dim t As Transaction = db.TransactionManager.StartTransaction()
Dim idArray() As ObjectId = Nothing

plese recitfy the problem.
Thaqs in advance
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Do you have 60 seconds to spare? The Autodesk Community Team is revamping our site ranking system and we want your feedback! Please click here to launch the 5 question survey. As always your input is greatly appreciated.