- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
References get created fine (Z axis) but nevertheless when the program hits dimension creation it throws an error 'The direction of dimension is invalid.'
XYZ p1z = new XYZ(-5, 5, 5);
XYZ p2z = new XYZ(5, 5, 5);
XYZ p3z = new XYZ(-5, 5, 10);
XYZ p4z = new XYZ(5, 5, 10);
XYZ cutVecZ = new XYZ(0, 1, 0);
using (Transaction t = new Transaction(doc, "Refplanes"))
{
t.Start();
refplane1 = doc.FamilyCreate.NewReferencePlane(p1z, p2z, cutVecZ, uidoc.ActiveGraphicalView);
refplane2 = doc.FamilyCreate.NewReferencePlane(p3z, p4z, cutVecZ, uidoc.ActiveGraphicalView);
t.Commit();
}
Line lin = Line.CreateBound(p1z, p3z);
ReferenceArray ra = new ReferenceArray();
ra.Append(refplane1.GetReference());
ra.Append(refplane2.GetReference());
using (Transaction t = new Transaction(doc, "Dimension"))
{
t.Start();
var dim3 = doc.FamilyCreate.NewLinearDimension(uidoc.ActiveGraphicalView, lin, ra);
t.Commit();
}
Solved! Go to Solution.
Link copied