Allows access to an MLeader.
C# code snippet:
public override void Execute()
{
CommandMessage commandline = application.GetCommandMessage();
if (null == commandline)
{
return;
}
Document dsDoc = application.GetActiveDocument();
if (null == dsDoc)
{
return;
}
Model dsModel = dsDoc.GetModel();
if (null == dsModel)
{
return;
}
SketchManager dsSketchManager = dsModel.GetSketchManager();
if (null == dsSketchManager)
{
return;
}
MLeader dsMLeader = dsSketchManager.InsertMLeaderWithNoneContentType( new double[] { 0.0, 0.0, 0.0, 100.0, 100.0, 0.0 }, dsMLeaderType_e.dsMLeaderType_Straight);
if (null == dsMLeader)
{
commandline.PrintLine("InsertMLeaderWithNoneContentType: Failed to create MLeader");
}
dsMLeader = dsSketchManager.InsertMLeaderWithToleranceContentType(new double[] { 0.0, 0.0, 0.0, 150.0, 150.0, 0.0 }, "{\\Fgdt;i}vvvb{\\Fgdt;l}vv\n5\n123", dsMLeaderType_e.dsMLeaderType_Straight, dsMLeaderTolAttachmentType_e.dsMLeaderTolAttachmentType_Middle );
if (null == dsMLeader)
{
commandline.PrintLine("InsertMLeaderWithToleranceContentType: Failed to create MLeader");
}
// Please create a block for this method
dsMLeader = dsSketchManager.InsertMLeaderWithBlockContentType(new double[] { 0.0, 0.0, 0.0, 200.0, 200.0, 0.0 }, "<block name>", dsMLeaderType_e.dsMLeaderType_Straight);
if (null == dsMLeader)
{
commandline.PrintLine("InsertMLeaderWithBlockContentType: Failed to create MLeader");
}
dsMLeader = dsSketchManager.InsertMLeaderWithNoteContentType(new double[] { 0.0, 0.0, 0.0, 250.0, 250.0, 0.0 }, 20.0, "MLeader with note", dsMLeaderType_e.dsMLeaderType_Straight);
if (null == dsMLeader)
{
commandline.PrintLine("InsertMLeaderWithNoteContentType: Failed to create MLeader");
}
}