.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

how get an entity from autocad to .Net Form

0 REPLIES 0
Reply
Message 1 of 1
jayapradha
237 Views, 0 Replies

how get an entity from autocad to .Net Form

Hello

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.

Code:
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
0 REPLIES 0

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost