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

How to Create a leader Object?

2 REPLIES 2
Reply
Message 1 of 3
Anonymous
337 Views, 2 Replies

How to Create a leader Object?

I Want to Create a leader object with the following method,but it doen't work fine.why?
public static ObjectId DrawLine(Point3d startPoint,Point3d endPoint)
{
ObjectId lineId = ObjectId.Null;// The return value for this function
Database db = HostApplicationServices.WorkingDatabase; using (Transaction trans = db.TransactionManager.StartTransaction())
{
BlockTable bt = trans.GetObject(db.BlockTableId, OpenMode.ForWrite) as BlockTable;
BlockTableRecord btr = bt[BlockTableRecord.ModelSpace].GetObject(OpenMode.ForWrite) as BlockTableRecord;
Leader leader = new Leader(); leader.AppendVertex(startPoint);
leader.AppendVertex(endPoint);
lineId = btr.AppendEntity(leader);
trans.AddNewlyCreatedDBObject(leader, true);
trans.Commit();
}
return lineId;
}
2 REPLIES 2
Message 2 of 3
cadMeUp
in reply to: Anonymous

It should be drawing the leader fine? What is not working? I tested it and got the return id fine. If the arrowhead does not show and it looks like a regular line, the length of the leader may be too short.
Message 3 of 3
Anonymous
in reply to: Anonymous

I reset the startPoint and endPoint ,it's really fine.
Thank you very much.

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