Message 1 of 3
NewAlignment:the two references are not geometrically aligned
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
hello,
How can i achieve the condition of geometrically aligned?
I use the following code to test the newalignment API, but always throw an exception of "the two references are not geometrically aligned". What is the reason? What is "geometrically aligned" mean?
thank you
var uidoc = commandData.Application.ActiveUIDocument;
var doc = uidoc.Document;
var selection = uidoc.Selection;
using (Transaction tra = new Transaction(doc, "33"))
{
tra.Start();
Line line0 = Line.CreateBound(XYZ.Zero, new XYZ(10, 0, 0));
Line line1 = Line.CreateBound(new XYZ(0, 10, 0), new XYZ(10, 10, 0));
var l = doc.Create.NewDetailCurve(doc.ActiveView, line0);
var ll = doc.Create.NewDetailCurve(doc.ActiveView, line1);
doc.Regenerate();
doc.Create.NewAlignment(doc.ActiveView, new Reference(l), new Reference(ll));
tra.Commit();
}
return Result.Succeeded;