For more information about the different units and precision types available for the rule methods in this section, see Bill of Material Units.
FormatValueWithUnits
Formats a value into a specific unit based on the specified precision.
Parameters
businessObject - The object(Part) that contains the attribute
If the attribute is not an occurrence attribute specified in the catalog, set this value to Nothing. The software uses the support object(Assembly) when businessObject is set to Nothing.
interfaceName - The name of the interface on which the attribute is defined
attribute - The attribute name
value - The attribute value
primaryUnits - The units to which the software converts the value. The software uses the default catalog units if you do not specify a value. This parameter is optional.
secondaryUnits - The secondary units used to combine different unit types. For example, define primaryUnits as DISTANCE_FEET and secondaryUnits as DISTANCE_INCH. The software formats the value in feet and inches (for example, 4ft 3in).
precisionType - The precision type 0 (decimal), 1 (fractional), or 2 (scientific). This parameter is optional.
precision - The precision of the value, based on the precisionType setting. This parameter is optional.
The precisionType setting determines the value the precision parameter returns. The available precisionType values that affect the precision parameter are listed below.
precisionType = 0 - The number of digits after the decimal
precisionType = 1 - The precision of the denominator
Returns
The formatted value as a string
Code
FormatValueWithUnits(SupportOrComponent, "IJUAhsFrameSpan", "SpanValue", spanValue, primaryUnits, secondaryUnits, precisionType, precision);
GetAttribute
Retrieves an attribute from a support component.
Parameters
interfaceName - The interface of the attribute to retrieve
attributeName - The attribute name to retrieve
supportComponent - The support component from which the software retrieves the attribute
Returns
Property value of the attribute
Code
coldLoad = (double)((PropertyValueDouble)DDSRuleServices.GetAttribute("IJUAhsInstalledLoad", "InstalledLoad", componentDictionary[SPRINGVSMID + Index])).PropValue;
GetAttribute
Retrieves an attribute from a support.
Parameters
interfaceName - The interface of the attribute to retrieve
attributeName - The attribute name to retrieve
support - The support from which the software retrieves the attribute
Returns
Property value of the attribute
Code
rodDiameter = (double)((PropertyValueDouble)DDSRuleServices.GetAttribute("IJUAHgrRHS_RodDiameter", "RodDiameter", support)).PropValue;
Returns
Property value of the attribute
GetAttribute
Retrieves an attribute from a business object.
Parameters
interfaceName - The interface of the attribute to retrieve
attributeName - The attribute name to retrieve
part - The business object from which the software retrieves the attribute
Returns
Property value of the attribute
Code
businessObjectValue = (double)((PropertyValueDouble)DDSRuleServices.GetAttribute("IJUASomeInterface", "Name", businessObject)).PropValue;
GetAttributeFromShape
Returns the value of a given attribute based on the shapeName.
Parameters
shapeName - The shape name
interfaceName - The interface name
attribute - The name of the attribute
Returns
The value of an attribute as an object
Code
GetAttributeFromShape(guideShape, "IJUAhsWidth1", "Width"))
GetCrossSectionDimensions
Retrieves the dimensions of the cross section.
Parameters
sectionStandard - The section Standard.
sectionType - The section type of the cross section
sectionName - The name of the section
width - The width of the cross section
flangeThickness - The flange thickness of the cross section
webThickness - The web thickness of the cross section
depth - The depth of the cross section
Returns
Not applicable
Code
double widthL, thicknessL, depthL, webThicknessL;DDSRuleServices.GetCrossSectionDimensions("Euro", "L", SectionSize, out widthL, out thicknessL, out webThicknessL, out depthL);
GetDoublePropertyValue
Retrieves a property if it is available on the support component or the support.
Parameters
part - The support component or the support in which the type is the business object
interfaceName - The name of the interface to which the property belongs
propertyName - The name of the property
propertyValue - The property value the software returns
Returns
The value of the property on the support component or support
Code
GetDoublePropertyValue(part, "IJUAhsHeight1","Height1",ref propertyValue)
GetIntPropertyValue
Retrieves a property if it is available on the support component or the support.
Parameters
part - The support component or the support in which the type is the business object
interfaceName - The name of the interface to which the property belongs
propertyName - The name of the property
propertyValue - The property value the software returns
Returns
The value of the property on the support component or support
Code
GetIntPropertyValue(part, "IJUAhsHeight1","Height1",ref propertyValue)
GetPartByClassAndNDSize
Retrieves the part number based on the provided part class and nominal diameter.
Parameters
partClassName - The part class that contains the matching part
ND - The nominal diameter
Support - The support that calls the GetPartByClassAndNDSize
Returns
The part number
Code
ruleResult[0] = DDSRuleServices.GetPartByClassAndNDSize(sPartClass, trunnionDia, support);
GetPartPort
Retrieves the specified port from the given part
Parameters
part - The part from which the port is retrieved
portName - The name of the port
Returns
The port object with the specified name on the support component
Code
Port hgrPort = DDSRuleServices.GetPartPort(somePart, somePortName);
GetSectionDataFromPart
Uses the supplied part number to retrieve all relevant data for the steel cross section.
Parameters
partNumber - The part number of a steel member. The steel member must be a Hanger Beam or a Smart Steel part.
vector1 - The Vector1
vector2 - The Vector2
Returns
A user-defined hsSteelMember type that contains the cross section information
Code
GetSectionDataFromPart(partNumber)
GetSectionDataFromPartIndex
Uses the supplied part Key to retrieve all relevant data for the steel cross section.
Parameters
customSupportDefinition - The part key of a steel member. The steel member must be a Hanger Beam or a Smart Steel part.
Returns
A user-defined hsSteelMember type that contains the cross section information
Code
GetSectionDataFromPartIndex(this,partKey)
GetSourceLine
Returns the class line number that called the source line.
Parameters
None
Returns
The source line number
Code
string spring = DDSRuleServices.GetSourceLine();
GetSupportingSectionData
Retrieves the relevant data for the steel cross section of the supporting object.
Parameters
customSupportDefinition - Contains the support definition. This is an abstract class.
index - The index of the supporting object for cross sectional data
Returns
A user-defined hsSteelMember type that contains the cross section information
Code
GetSupportingSectionData(this,1)
IsInterfaceSupported
Checks whether the interface is supported by the sub-assembly part or by the support. This check is available whether the caller is a sub-assembly or a super-assembly.
Parameters
interface - The name of the interface
support - The support to check. Use this parameter only when subAssemblyPart is null.
subAssemblyPart - The sub-assembly part to check
Returns
True if the interface is supported; false if the interface is not supported.
Code
Part subAssemblyPart; Ingr.SP3D.Support.Middle.Support support = SupportHelper.Support;CatalogBaseHelper catalogBaseHelper = new CatalogBaseHelper(); subAssemblyPart = catalogBaseHelper.GetPart(subAssemblyPartNumber) as Part; if (DDSRuleServices.IsInterfaceSupported("IJUAhsGuideTopPlateW", support, subAssemblyPart))
SetAttribute
Sets an attribute on a support or a support component.
Parameters
interfaceName - The interface of the attribute to set
attributeName - The name of the attribute to set
supportComponent - The support (or support component) on which to set the attribute
Returns
Not applicable
Code
Support:
DDSRuleServices.SetAttribute(coldLoad, "IJUAHgrRH_VS_ColdLoad", "ColdLoad", support);
Support component:
DDSRuleServices.SetAttribute(pipeOutsideDiameter, "IJOAhsDiameter1", "Diameter1", componentDictionary[SHOE]);
TrunnionDiameterMetricToImperial
Converts the metric units of the input trunnion nominal diameter to Imperial units.
Parameters
diameterInMillimeters - The diameter of the trunnion in millimeters
Returns
The nominal diameter in Imperial units
Code
NDImperialUnit = DDSRuleServices.TrunnionDiameterMetricToImperial(trunnion diameter);