
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi everyone,
Here is my code to create a detail line. I want to create a line with 100mm in Length. But the length of the line is not 100mm as i need.
Thank you for your help.
[Transaction(TransactionMode.Manual)]
public class Command : IExternalCommand
{
public Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
{
UIApplication uiap = commandData.Application;
UIDocument uidoc = uiap.ActiveUIDocument;
Document doc = uidoc.Document;
View view = doc.ActiveView;
XYZ startPoint = new XYZ(0, 0, 0);
XYZ endPoint = new XYZ(100, 0, 0);
using (Transaction t = new Transaction(doc, "Creat Detail Line"))
{
t.Start();
Units u = new Units(UnitSystem.Metric);
doc.SetUnits(u);
Line l1 = Line.CreateBound(startPoint, endPoint);
doc.Create.NewDetailCurve(view, l1);
t.Commit();
TaskDialog.Show("Creat Detail Line", "Line was created");
}
return Result.Succeeded;
}
}
Solved! Go to Solution.