This is a question about changing the size after rotating the tap.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello. Dear Developers.
This is a problem when using the NewTakeOffFitting() method that connects the tap to the duct and the connection part of the duct.
When this method is used, the tab is created with the default Rotation value.
The problem occurs when the Revit user rotates the Tap using the Rotate function of the UI.
I can't reproduce the functionality of that blue recycle-shaped icon.
The blue rotation icon didn't just rotate an object.
If you look at the two pictures below, the size changes. Automatically.
After rotating counterclockwise
Here is the result after my work.
The NewTakeOffFitting method automatically creates a tab, but
The tab created in this way has a size of isReadOnly == true.
I have no control.
Here is part of the code that creates a new tab.
Connector con = (tapInfo.child as Duct).ConnectorManager.Connectors.Cast<Connector>().ToList().OrderBy(x => x.Origin.DistanceTo(midpt)).FirstOrDefault();
newtap = doc.Create.NewTakeoffFitting(con, parent as Duct);
Line axis = Line.CreateBound(tapInfo.locationPoint, tapInfo.tapConnOrigin2);
double tapangle = Math.PI;
LocationPoint lp = newtap.Location as LocationPoint;
var qrytapinfo = tapRots.Where(x => x.tapPos.IsAlmostEqualTo(lp.Point)).FirstOrDefault();
if (qrytapinfo != null)
{
Connector tapconn = newtap.MEPModel.ConnectorManager.Lookup(1);
XYZ xbasis = tapconn.CoordinateSystem.get_Basis(0);
double tapRot = xbasis.AngleTo(XYZ.BasisX);
double radianRot = Math.Abs(tapRot - qrytapinfo.tapRot);
tapangle = radianRot;
}
ElementTransformUtils.RotateElement(m_doc, newtap.Id, axis, tapangle);
//newtap.Location.Rotate(axis, tapangle); // same result above RotateElement()
Here is the Xaxis angle of the connector I analyzed to get the tap rotation.
The code above worked after analyzing each angle as shown in the image.
Please someone please tell me how to solve this problem.
Thank you for your interest in my article.