Objects that are added using OSD can be converted to Dimension Ports by setting the Dimensioned property on Note to True. When the dimension port is added, the dimensions are displayed in the isometric drawings. In the following example, add the dimension ports in the CSD to obtain the horizontal and vertical dimensions as shown below:
Every dimension requires two dimension ports.
-
Open Assy_RR_DR_LS.cls in the PipeHgrAssemblies.csproj available in the following folder
[Product Folder]\3D\ Programming\ExampleCode\HangersAndSupports\Rules\CustomSupportDefinition\Pipe\PipeHgrAssemblies
-
Define the required dimension ports as global variable in the class file.
private string[] Dimensionkeys = new string[5];
-
Add the following code to retrieve dimensional data from the assembly part definition in the Parts method
CatalogBaseHelper catalogBaseHelper = new CatalogBaseHelper();
PartClass hsDimensionPortPartClass = (PartClass)catalogBaseHelper.GetPartClass("HSDimensionPort");
ReadOnlyCollection<BusinessObject> Parts = hsDimensionPortPartClass.Parts;
if (Parts.Count > 0)
isDimensionPort = true;
-
Add the following code to specify the part class constituting the assembly:
if (isDimensionPort == true)
{
for (index = 1; index <= 5; index++)
{
Dimensionkeys[index - 1] = "DimensionPort" + index.ToString();
parts.Add(new PartInfo(Dimensionkeys[index - 1], "HSDimensionPort" + "_1"));
}
}
-
Add the following code to place the dimension ports in the required location and obtain the dimensions in the ConfigureSupport method:
JointHelper.CreateRigidJoint(HOR_SECTION, "BeginCap", Dimensionkeys[0], "Dimension", Plane.XY, Plane.XY, Axis.X, Axis.X, 0, 0, 0);//9444
JointHelper.CreateRigidJoint(Dimensionkeys[1], "Dimension", Dimensionkeys[0], "Dimension", Plane.XY, Plane.XY, Axis.X, Axis.X, -overhang, 0, 0);//9444
if (SupportHelper.PlacementType == PlacementType.PlaceByStruct)
JointHelper.CreateRigidJoint(Dimensionkeys[0], "Dimension", Dimensionkeys[2], "Dimension", Plane.XY, Plane.XY, Axis.X, Axis.X, W1 + W2 + overhang + overhang, 0, 0);
else
JointHelper.CreateRigidJoint(Dimensionkeys[0], "Dimension", Dimensionkeys[2], "Dimension", Plane.XY, Plane.XY, Axis.X, Axis.X, lengthHor1 + lengthHor2 + overhang + overhang, 0, 0);
JointHelper.CreateRigidJoint(Dimensionkeys[3], "Dimension", Dimensionkeys[0], "Dimension", Plane.XY, Plane.XY, Axis.X, Axis.X, 0, lengthVert1, 0);
JointHelper.CreateRigidJoint(Dimensionkeys[0], "Dimension", Dimensionkeys[4], "Dimension", Plane.XY, Plane.XY, Axis.X, Axis.X, 0, -lengthVert2, 0);
-
Add the following code to set the note on the support dimension ports.
CodelistItem fabrication;
string[] noteName = new string[] { "L_Start", "L_Mid", "L_End", "L_1", "L_2" };
for (index = 0; index < 5; index++)
{
Note noteLStart = CreateNote(noteName[index], componentDictionary[Dimensionkeys[index]], "Dimension");
noteLStart.SetPropertyValue(noteName[index], "IJGeneralNote", "Text");
fabrication = noteLStart.GetPropertyValue("IJGeneralNote", "Purpose").PropertyInfo.CodeListInfo.GetCodelistItem(3);
noteLStart.SetPropertyValue(fabrication, "IJGeneralNote", "Purpose"); //value 3 means fabrication
noteLStart.SetPropertyValue(true, "IJGeneralNote", "Dimensioned");
}
-
Compile the PipeHgrAssemblies.dll and place it in the following folder:
[Product Folder]\3DRefData\SharedContent\Bin\HangersAndSupports\Rules\Release
-
Place the support in the Hangers and Supports task by selecting Assy_RR_DR_LS as the value for Type box.
The nodes are added and the dimensions are displayed between the dimension ports.