Cross Sections
The methods in this section enable you to create, access, modify, and delete cross sections.
Listing Cross Sections
Methods Introduced:
The method pfcSolid::ListCrossSections returns a sequence of cross section objects represented by the Xsection interface. The method pfcSolid::GetCrossSection searches for a cross section given its name.
The method pfcXSection::GetName returns the name of the cross section in the Creo application. The method pfcXSection::SetName modifies the cross section name.
The method pfcXSection::GetXSecType returns the type of cross section as a pfcXSecType object, that is planar or offset, and the type of item intersected by the cross section.
The method pfcXSecType::GetType returns the type of intersection for the cross section using the enumerated type pfcXSecCutType. The valid values are:
•  pfcXSEC_PLANAR
•  pfcXSEC_OFFSET
The method pfcXSecType::GetObjectType returns the type of item intersected by the cross section using the enumerated type pfcXSecCutobjType. The valid values are:
•  pfcXSECTYPE_MODEL—Specifies that the cross section was created on solid geometry.
•  pfcXSECTYPE_QUILTS—Specifies that the cross section was created on one quilt surface.
•  pfcXSECTYPE_MODELQUILTS—Specifies that the cross section was created on solid geometry and all quilt surfaces.
•  pfcXSECTYPE_ONEPART—Specifies that the cross section was created on one component in the assembly.
The method pfcXSection::Delete deletes a cross section.
The method pfcXSection::Display forces a display of the cross section in the window.
The method pfcXSection::Regenerate regenerates the cross-section of a part or an assembly.
Extracting Cross-Sectional Geometry
Methods Introduced:
The geometry of a cross section in an assembly is divided into components. Each component corresponds to one of the parts in the assembly that is intersected by the cross section, and describes the geometry of that intersection. A component can have disjoint geometry if the cross section intersects a given part instance in more than one place.
A cross section in a part has a single component.
The components of a cross section are identified by consecutive integer identifiers that always start at 0.
The method wfcWXSection::CollectGeometry returns the object wfcXSectionGeometries that contains the geometry of all components in the specified cross section. wfcXSectionGeometries retrieves information from the wfcXSectionGeometry object.
The method wfcXSectionGeometry::GetGeometry returns the geometry of all components in the specified cross section as pfcSurface object. Use the methods wfcXSectionGeometry::GetMemberIdTable and wfcXSectionGeometry::GetQuiltId to get the component and quilt identifiers in the specified cross section.
The method wfcWXSection::GetPlane returns the plane geometry for a specified cross section.
The method wfcWXSection::GetOffsetXSectionData returns the parameters for a specified offset cross section.
The method wfcOffsetXSectionData::GetXSectionLines returns information about the line segment entities in the cross section as a wfcSectionEntityLine object.
The method wfcOffsetXSectionData::GetPlaneData returns information about the entity datum plane.
The method wfcOffsetXSectionData::GetOneSided returns True if the cross section lies on one side of the entity plane. The method returns false if the cross section is both-sided.
If the output argument of the method wfcOffsetXSectionData::GetFlip is False, the Creo application removes material from the left of the cross section entities if the viewing direction is from the positive side of the entity plane and if wfcOffsetXSectionData::GetOneSided is true, the Creo application removes only the material from positive side of the entity plane.
Creating and Modifying Cross Sections
Methods Introduced:
The method wfcWSolid::CreateParallelXSection creates a cross section feature parallel to a given plane.
The method wfcWSolid::CreatePlanarXSection creates a cross section feature through a datum plane. The input arguments are:
•  Name —Specifies the name of the cross section.
•  PlaneId —Specifies the ID of the cutting plane. The cutting plane must belong to the model.
•  CutObjectType—Specifies the type of object that will be cut by the cross section. It is specified by the enumerated type pfcXSecCutobjType.
•  MemberIdTable—Specifies the path to the assembly component being cut. If the CutObjectType is pfcXSECTYPE_QUILTS, then only the quilt with specified QuiltId is cut in this component. If the CutObjectType is pfcXSECTYPE_ONEPART, then only solid geometry of this component is cut.
•  QuiltId—Specifies the ID of the quilt when CutObjectType is pfcXSECTYPE_QUILTS. The quilt must belong to the top assembly or any of its sub-assemblies and parts. When the object to be cut is not a quilt specify the value as false.
Note
•  The legacy cross sections, that is, the cross sections created in Pro/ENGINEER, Creo Elements/Pro, and in releases prior to Creo Parametric 2.0 are not supported.
•  The methods wfcWSolid::CreateParallelXSection and wfcWSolid::CreatePlanarXSection automatically convert the legacy cross sections to new cross section features as defined in Creo Parametric 2.0 onward, before creating any new cross section feature.
Use the method wfcWModel::CanCreateSectionFeature to check if new cross section features can be created in the specified model. The method returns false if the specified model has legacy cross sections.
The method wfcWModel::ConvertOldXSectionsToNew converts the legacy cross sections to new cross section features as defined in Creo Parametric 2.0 onward for the specified model.
Use the method wfcWXSection::IsFeature to check whether the cross section is a feature.
The method wfcWXSection::GetFeature returns a pfcFeature object representing the cross section feature. You must use this method only if wfcWModel::CanCreateSectionFeature returns true.
Mass Properties of Cross Sections
Method Introduced:
The method wfcWXSection::GetMassProperty calculates the mass properties of the cross-section in the specified coordinate system. The method needs the name of a coordinate system datum whose X- and Y-axes are parallel to the cross section. The output from this method also refers to the coordinate system datum.
Note
•  The method wfcWXSection::GetMassProperty is not supported for offset and quilt type of cross-sections.
•  The following methods can be called on MassProperty object returned by wfcWXSection::GetMassProperty:
  pfcSolid::MassProperty
  pfcMassProperty::GetSurfaceArea
  pfcMassProperty::SetSurfaceArea
  pfcMassProperty::GetGravityCenter
  pfcMassProperty::SetGravityCenter
  pfcMassProperty::GetCoordSysInertia
  pfcMassProperty::SetCoordSysInertia
Line Patterns of Cross Section Components
Methods Introduced:
The method wfcWXSection::GetCompXSectionHatches returns the line patterns of a cross section as a wfcXSectionHatches object. The input arguments to the method are the ID of the cross section component and the drawing view containing the cross section component. The information related to line patterns is obtained from wfcXSectionHatch. Use the method wfcWXSection::SetCompXSectionHatches to set the line patterns for a cross section.
The method wfcXSectionHatch::Create creates a data object that contains information about the line patterns.
Use the methods wfcXSectionHatch::GetAngle and wfcXSectionHatch::SetAngle to get and set the angle in the line patterns.
The methods wfcXSectionHatch::GetSpacing and wfcXSectionHatch::SetSpacing get and set the distance between the line patterns.
The methods wfcXSectionHatch::GetOffset and wfcXSectionHatch::SetOffset get and set the offset of the first line in the pattern.
Example 1: Creating a Planar Cross Section and Editing the Hatch Parameters
The sample code in OTKXCrossSection.cxx located at <creo_otk_loadpoint_app>/otk_examples/otk_examples_solid shows how to create a planar cross section using the Creo Object TOOLKIT C++ methods. It also shows how to edit hatch parameters for all the cross sections in the current model.