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

how get an entity from autocad to .Net Form

55 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

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community