.NET

Reply
Valued Contributor
nlvvch
Posts: 50
Registered: ‎03-21-2006
Message 1 of 5 (174 Views)

draw the line and pline

174 Views, 4 Replies
06-08-2007 04:37 AM
please help me iam learning stage i did make mistache below code please correct them or else
please give some code for adding line antity and pline entity in atocad current view

try
{
Trans = MyDb.TransactionManager.StartTransaction();
lne = new Line2d(prPointRes.Value,prPointRes1.Value);
Bt = (BlockTable)Trans.GetObject(MyDb.BlockTableId,OpenMode.ForRead);
Btr = (BlockTableRecord)Trans.GetObject(MyDb.CurrentSpaceId,OpenMode.ForWrite);

Btr.AppendEntity(lne);
Trans.AddNewlyCreatedDBObject(lne,true);
Trans.Commit();
Trans.Dispose();


}
*Norman Yuan
Message 2 of 5 (174 Views)

Re: draw the line and pline

06-08-2007 07:34 AM in reply to: nlvvch
You (or Acad) draw(s) "Line", not Line2d.

Line is Acad's Database residing object with such base
classes ->Curve->Entity->DBObject->Drawable-RXObject..., while Line2d is
geometric representation of a 2D line with this base class
chain ->LinearEntity2d->Curve2d->Entity2d->DisposableWrapper....

Notice Line is Drawable and DBObject, while Line2d is not.


wrote in message news:5620479@discussion.autodesk.com...
please help me iam learning stage i did make mistache below code please
correct them or else
please give some code for adding line antity and pline entity in atocad
current view

try
{
Trans = MyDb.TransactionManager.StartTransaction();
lne = new Line2d(prPointRes.Value,prPointRes1.Value);
Bt = (BlockTable)Trans.GetObject(MyDb.BlockTableId,OpenMode.ForRead);
Btr =
(BlockTableRecord)Trans.GetObject(MyDb.CurrentSpaceId,OpenMode.ForWrite);

Btr.AppendEntity(lne);
Trans.AddNewlyCreatedDBObject(lne,true);
Trans.Commit();
Trans.Dispose();


}
Valued Contributor
nlvvch
Posts: 50
Registered: ‎03-21-2006
Message 3 of 5 (174 Views)

Re: draw the line and pline

06-10-2007 10:12 PM in reply to: nlvvch
hi sir please cane u give one sample for draw the simple line or pline
Distinguished Contributor
Fatty
Posts: 1,986
Registered: ‎08-02-2004
Message 4 of 5 (174 Views)

Re: draw the line and pline

06-10-2007 11:39 PM in reply to: nlvvch
See function 'DrawLine' written by Mikko
in this thread:
http://discussion.autodesk.com/thread.jspa?messageID=4871486

~'J'~
Valued Contributor
nlvvch
Posts: 50
Registered: ‎03-21-2006
Message 5 of 5 (174 Views)

Re: draw the line and pline

06-11-2007 04:33 AM in reply to: nlvvch
hi friends

thanx for ur reply

venkaesh
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Are You Going To Be @ AU 2014? Feel free to drop by our AU topic post and share your plans, plug a class that you're teaching, or simply check out who else from the community might be in attendance. Ohh and don't forgot to stop by the Autodesk Help | Learn | Collaborate booths in the Exhibit Hall and meet our community team if you get a chance!