GetDrillingsFromDrillingPattern Method
Returns drilling objects which are generated based on drilling pattern assigned to 3d placement part.
Parameters
- pPlacement
- 3D placement for which drilling objects will be generated. Can't be
null
.
Return Value
Array of generated drilling objects or empty array.
Example below prints out to consol basic information about drillings from drilling pattern:
//find duct object in project
DMObjectsFinder oFinder = new DMObjectsFinder(oProject);
Duct oDuct = oFinder.GetFunctions3D(null).OfType<Duct>().First();
//get all drilling objects from duct
Drilling[] arrDrillings = new Placement3DService().GetDrillingsFromDrillingPattern(oDuct);
foreach (Drilling oDrilling in arrDrillings)
{
Console.WriteLine("------- Drilling -------");
//write the relative position on parent
Console.WriteLine(
String.Format(
"Relative position: ({0}, {1}, {2})",
oDrilling.RelativeTransformation.OffsetX,
oDrilling.RelativeTransformation.OffsetY,
oDrilling.RelativeTransformation.OffsetZ));
//write the type of drilling
Console.WriteLine(
String.Format(
"Type of drilling: {0}",
oDrilling.FunctionDefinition.Id));
}