The pipe inline orientation can be accessed using XAxis and ZAxis properties. From the help file, we can read:
- xAxis: Input vector (in WCS) to be used to define the new plane that will contain the inline asset
- zAxis: Input X-Direction vector (WCS) for the inline asset
And, as the properties are read-only, we can change them using the SetOrientation method.
Despite the explanation, a graphical visualization can help we understand the properties. After writing a small piece of code to change the properties, we can see the following:
XAxis: change the asset orientation regarding the flow on the pipe line, as shown on the image below.
ZAxis: rotate the asset along the pipe line axis, helping place it properly, as shown below.
If you need to change any of those directions, then notice that the vectors are unit vectors. Below is a sample code that changes both X and Z directions (just invert the values).
public void CmdAssetOrientation()
Editor ed = Application.DocumentManager.
PromptEntityOptions peo = new
PromptEntityOptions("Select inline asset");
peo.SetRejectMessage("Only inline asset");
PromptEntityResult per = ed.GetEntity(peo);
if (per.Status != PromptStatus.OK) return;
Database db = Application.DocumentManager.
using (Transaction trans =
PipeInlineAsset pipeAsset =
// get current values
Point3d position = pipeAsset.Position;
Vector3d xDir = pipeAsset.XAxis;
Vector3d zDir = pipeAsset.ZAxis;
// change the direction the asset is comparing to the line
// for instance, a valve will change rotate along the line
Vector3d zDirInverted = zDir.Negate();
// change the orientation of the asset
// for instace, a valve will change the in/out of the flow
Vector3d xDirInverted = xDir.Negate();
// apply the new value