Curve and Surface Collection
This section describes the Creo Object TOOLKIT C++ methods to access the details of curve and surface collections for query and modification. Curve and surface collections are required inputs to a variety of Creo tools such as Round, Chamfer, and Draft.
Introduction to Curve and Surface Collection
A curve collection or chain is a group of separate edges or curves that are related, for example, by a common vertex, or tangency. Once selected, these separate entities are identified as a chain so they can be modified as one unit.
The different chain types are as follows:
•  One-by-one—a chain of edges, curves or composite curves, each adjacent pair of which has a coincident endpoint. Some applications may place other conditions on the resulting chain.
•  Tangent—a chain defined by the selected item and the extent to which adjacent entities are tangent.
•  Curve—an entire composite curve or some portion of it that is defined by two component curves of the curve.
•  Boundary—an entire loop of one-sided edges that bound a quilt or some portion thereof defined by two edges of the boundary loop.
•  Surf Chain—an entire loop of edges that bound a face (solid or surface) or some portion of it that is defined by two edges of the loop.
•  Intent Chain—an intent chain entity, usually created as the result of two intersecting features.
•  From/To—a chain that begins at a start-point, follows an edge line, and ends at the end-point.
Surface sets are one or more sets of surfaces either for use within a tool, or before entering a tool.
The definition of a surface set may not be independent in all respects from that of any other. In other words, the ability to construct some types of surface sets may depend on the presence of or on the content of others. On this account, we have different surface sets as follows:
•  One-by-One Surface Set—Represents a single or a set of single selected surfaces, which belong to solid or surface geometry.
•  Intent Surface Set—Represents a single or set of intent surfaces, which are used for the construction of the geometry of features. This instruction facilitates the reuse of the feature construction surface geometry as "intent" reference. This is also known as "logical object surface set".
•  All Solid or Quilt Surface Set—Represents all the solid or quilt surfaces in the model.
•  Loop Surface Set—Represents all the surfaces in the loop in relation with the selected surface and the edge. This is also known as "neighboring surface set".
•  Seed and Boundary Surface Set—Represents all the surfaces between the seed surface and the boundary surface, excluding the boundary surface itself.
Surface set collection can be identified as a gathering a parametric set of surfaces in the context of a tool that specifically requests surface sets and is nearly identical to selection of a surface set.
Chain collection can be identified as gathering a chain in the context of a tool that specifically requests chain objects and is nearly identical to chain selection.
Collection is related to Selection as follows:
Selection is the default method of interaction with Creo system. Selection is performed without the context of any tool. In other words, the system does not know what to do with selected items until the user tells the system what to do. Collection is essentially Selection within the context of a tool. Items are gathered for a specific use or purpose as defined by the tool, which forms the Collection. It is possible to convert the collections into the sets of selections using the collection APIs.
Interactive Collection
Method Introduced:
Use the method wfcWSolid::CollectCurves to interactively create a collection of curves by invoking a chain collection user interface.
Chain Collection User Interface
Image
The input arguments for the method wfcWSolid::CollectCurves are as follows:
•  ChainControls—Specifies an array defining the permitted instruction types that will be allowed to use in the user interface. The following instruction types are supported:
  wfcCHAINCOLLUI_ONE_BY_ONE—for creating "One by One" chain.
  wfcCHAINCOLLUI_TAN_CHAIN—for creating "Tangent" chain.
  wfcCHAINCOLLUI_CURVE_CHAIN—for creating "Curve" chain.
  wfcCHAINCOLLUI_BNDRY_CHAIN—for creating "Boundary Loop" chain.
  wfcCHAINCOLLUI_FROM_TO—for creating "From-To" chain.
  wfcCHAINCOLLUI_ALLOW_LENGTH_ADJUSTMENT—for allowing length adjustment in curves.
  wfcCHAINCOLLUI_ALLOW_ALL—for allowing all the supported instruction types.
  wfcCHAINCOLLUI_ALLOW_EXCLUDED—for excluding chain.
  wfcCHAINCOLLUI_ALLOW_APPENDED—for appending chain.
•  FilterMethod—Specifies the filter method wfcCollectCurvesFilter::FilterSelections. The filter method is called before each selection is accepted. If you want your application to reject a certain selection, FilterMethod should return false for that particular selection. You can pass null to skip the filter.
•  AppData—Specifies the application data that will be passed to the filter method.
•  AppendColl—Appends the curve collection to the final wfcCollection object that will be returned. If this collection already contains instructions, then they will be appended into the details shown in the Chain collection user interface. Use the programmatic methods to access curve collections and to extract the required information.
The method returns a handle to wfcCollection object describing the current resulting curves and edges from the collection.
Use the method wfcWSolid::CollectSurfaces to interactively create a collection of surfaces by invoking a surface sets dialog.
Surface Sets dialog box
Image
The input arguments for the method wfcWSolid::CollectSurfaces are:
•  InstrTypes—Specifies an array defining the permitted instruction types for surfaces using the enumerated type wfcSurfaceCollectionInstrType. Surface collection instructions can be of the following types:
  wfcSURFCOLL_SINGLE_SURF—Instruction specifying a set of single surfaces.
  wfcSURFCOLL_SEED_N_BND—Instruction specifying a combination of Seed and Boundary type of surfaces.
  wfcSURFCOLL_QUILT_SRFS—Instruction specifying quilt type of surfaces.
  wfcSURFCOLL_ALL_SOLID_SRFS—Instruction specifying all solid surfaces in the model.
  wfcSURFCOLL_NEIGHBOR—Instruction specifying neighbor type of surfaces (boundary loop).
  wfcSURFCOLL_NEIGHBOR_INC—Instruction specifying neighbor type of surfaces (boundary loop) and also includes the seed surfaces.
  wfcSURFCOLL_ALL_QUILT_SRFS—Instruction specifying all quilts in the model.
  wfcSURFCOLL_ALL_MODEL_SRFS—Instruction specifying all the surfaces in the model.
  wfcSURFCOLL_LOGOBJ_SRFS—Instruction specifying intent surfaces. Intent surfaces are also known as "logical objects".
  wfcSURFCOLL_DTM_PLN—Instruction specifying datum plane selection.
  wfcSURFCOLL_DISALLOW_QLT—Instruction specifying that do not allow selections from quilts.
  wfcSURFCOLL_DISALLOW_SLD—Instruction specifying that do not allow selections from solid geometry.
  wfcSURFCOLL_DONT_MIX—Instruction allowing selections from only solid or only quilt but no mixing.
  wfcSURFCOLL_SAME_SRF_LST—Instruction allowing selections from same solid or same quilt.
  wfcSURFCOLL_USE_BACKUP—Instruction prompting Creo to regenerate using backups.
  wfcSURFCOLL_DONT_BACKUP—Instruction specifying that do not back up copy of references.
  wfcSURFCOLL_DISALLOW_LOBJ—Instruction specifying that do not allow selections from intent surfaces or logical objects.
  wfcSURFCOLL_ALLOW_DTM_PLN—Instruction specifying datum plane selection.
  wfcSURFCOLL_SEED_N_BND_INC_BND—Instruction specifying a combination of Seed and Boundary type of surfaces and also includes the seed surfaces.
  wfcSURFCOLL_GEOM_RULE—Instruction specifying collection of surfaces using geometry rules.
  wfcSURFCOLL_TANG_SRF—Instruction specifying collection of tangent surfaces.
  wfcSURFCOLL_SHAPE_BASED—Instruction specifying collection of shape based surfaces.
•  FilterMethod—Specifies the filter method wfcCollectSurfacesFilter::FilterSelections. The filter method is called before each selection is accepted. If you want your application to reject a certain selection, FilterMethod should return false for that particular selection. You can pass null to skip the filter.
•  AppendColl—Appends the surface collection to the final wfcCollection object that will be returned. If this collection already contains instructions, then they will be appended into the details shown in the Surface Sets collection user interface. Use the programmatic methods to access surface collections and to extract the required information.
Programmatic Access to Collections
The wfcCollection Interface
The wfcCollection interface contains curve and surface collection interfaces for programmatic access to collections. It represents a chain or surface set and extracts the details from an appropriate structure from the Creo application.
The collection object wfcCollection must contain either a collection of curves or a collection of surfaces. It must not contain a combination of both object types.
Methods Introduced:
The method wfcCollection::Create creates a data object that contains information about the collection of curves or surfaces.
The method wfcWModel::GenerateSelectionsFromCollection returns a sequence of pfcSelections object depending on the rules and instructions in the curve or surface collection.
Curve Collection
Methods Introduced:
The method wfcCollection::GetCrvCollection returns the collection of curves for the element PRO_E_STD_CURVE_COLLECTION_APPL for the specified model. Use the method wfcCollection::SetCrvCollection to set the collection of curves for the element PRO_E_STD_CURVE_COLLECTION_APPL.
The method wfcCurveCollection::Create creates a data object that contains information about the curve collection instructions.
Use the method wfcCurveCollection::GetInstructions and wfcCurveCollection::SetInstructions to get and set the instructions from the curve collection.
The method wfcCurveCollectionInstruction::Create creates a data object that contains information about the parameters set in the curve collection instructions.
The methods wfcCurveCollectionInstruction::GetAttributes and wfcCurveCollectionInstruction::SetAttributes get and set the attributes contained in a curve collection instruction.
Use the methods wfcCurveCollectionInstruction::GetReferences and wfcCurveCollectionInstruction::SetReferences to get and set the references contained in a curve collection instruction.
Use the methods wfcCurveCollectionInstruction::GetType and wfcCurveCollectionInstruction::SetType to get and set the curve collection instruction type using the enumerated type wfcCurveCollectionInstrType.
Curve collection instructions can be of the following types:
•  wfcCURVCOLL_EMPTY_INSTR—to be used when you do not want to pass any other instruction.
•  wfcCURVCOLL_ADD_ONE_INSTR—for creating "One by One" chain.
•  wfcCURVCOLL_TAN_INSTR—for creating "Tangent" chain.
•  wfcCURVCOLL_CURVE_INSTR—for creating "Curve" chain.
•  wfcCURVCOLL_SURF_INSTR—for creating "Surface Loop" chain.
•  wfcCURVCOLL_BNDRY_INSTR—for creating "Boundary Loop" chain.
•  wfcCURVCOLL_LOG_OBJ_INSTR—for creating "Logical Object" chain.
•  wfcCURVCOLL_PART_INSTR—for creating chain on all possible references, or to choose from convex or concave only.
•  wfcCURVCOLL_FEATURE_INSTR—for creating chain from feature curves.
•  wfcCURVCOLL_FROM_TO_INSTR—for creating "From-To" chain.
•  wfcCURVCOLL_EXCLUDE_ONE_INSTR—for excluding the entity from the chain.
•  wfcCURVCOLL_TRIM_INSTR—to trim chain.
•  wfcCURVCOLL_EXTEND_INSTR—to extend chain.
•  wfcCURVCOLL_START_PNT_INSTR—to set the chain start point.
•  wfcCURVCOLL_ADD_TANGENT_INSTR—to add all edges tangent to the ends of the chain.
•  wfcCURVCOLL_ADD_POINT_INSTR—to add selected point or points to the collection.
•  wfcCURVCOLL_OPEN_CLOSE_LOOP_INSTR—to add a closed chain that is considered as open.
•  wfcCURVCOLL_QUERY_INSTR—for creating “Query” chain.
•  wfcCURVCOLL_RESERVED_INSTR—to determine the number of instructions defined in the curve instruction.
•  wfcCURVCOLL_CNTR_INSTR—to add contours to the collection.
The methods wfcCurveCollectionInstruction::GetValue and wfcCurveCollectionInstruction::SetValue get and set the value of a curve collection instruction. These methods are used only for instructions of type wfcCURVCOLL_TRIM_INSTR and wfcCURVCOLL_EXTEND_INSTR.
The method wfcCrvCollectionInstrAttribute::Create creates a data object that contains information about the special attribute in curve collection instruction.
Use the method wfcCrvCollectionInstrAttribute::GetAttribute to check whether a special attribute is set for the curve collection instruction using the enumerated type wfcCurveCollectionInstrAttribute.
The curve collection instruction attributes can be of the following types:
•  wfcCURVCOLL_NO_ATTR—applicable when there are no attributes present.
•  wfcCURVCOLL_ALL—applicable for all edges.
•  wfcCURVCOLL_CONVEX—applicable for convex edges only.
•  wfcCURVCOLL_CONCAVE—applicable for concave edges only.
Use the method wfcCrvCollectionInstrAttribute::SetAttribute to set a special attribute in the curve collection instruction.
Use the method wfcCollectCurvesFilter::FilterSelections to check if the current curve selection satisfies the filter criteria. The curve selection is accepted only if the method returns True.
Surface Collection
Methods Introduced:
The method wfcCollection::GetSurfCollection returns the collection of surfaces for the element PRO_E_STD_SURF_COLLECTION_APPL for the specified model. Use the method wfcCollection::SetSurfCollection to set the collection of curves for the element PRO_E_STD_SURF_COLLECTION_APPL.
The method wfcSurfaceCollection::Create creates a data object that contains information about the surface collection instructions.
Use the methods wfcSurfaceCollection::GetInstructions and wfcSurfaceCollection::SetInstructions to get and set the instructions from the surface collection.
The method wfcSurfaceCollectionInstruction::Create creates a data object that contains information about the parameters set in the surface collection instructions.
Use the method wfcSurfaceCollectionInstruction::GetInclude to check the boolean value of the surface collection instruction attribute. If the value is set to True, the surfaces generated by this instruction add surfaces to the overall set. If the value is set to False, the surfaces generated by this instruction are removed from in the overall set.
Use the methods wfcSurfaceCollectionInstruction::GetSrfCollectionReferences and wfcSurfaceCollectionInstruction::SetSrfCollectionReferences to get and set the references contained in a surface collection.
Use the methods wfcSurfaceCollectionInstruction::GetType and wfcSurfaceCollectionInstruction::SetType to get and set the surface collection instruction type using the enumerated type wfcSurfaceCollectionInstrType.
The methods wfcSurfaceCollectionInstruction::GetRules and wfcSurfaceCollectionInstruction::SetRules get and set rules for surface collection instructions using the enumerated type wfcSurfaceCollectionRule. The valid values are:
•  wfcSURFCOLL_ALL_GEOM_RULE—Specifies that all the rules are applied. Otherwise, any applicable geometry rule is applied.
•  wfcSURFCOLL_CO_PLANNAR_GEOM_RULE—Specifies that the surfaces coplanar to the seed surface should be collected.
•  wfcSURFCOLL_PARALLEL_GEOM_RULE—Specifies that the surfaces parallel to the seed surface should be collected.
•  wfcSURFCOLL_CO_AXIAL_GEOM_RULE—Specifies that the surfaces coaxial with the seed surface should be collected.
•  wfcSURFCOLL_EQ_RADIUS_GEOM_RULE—Specifies that the surfaces with the same radius and type as the seed surface should be collected.
•  wfcSURFCOLL_SAME_CONVEXITY_GEOM_RULE—Specifies that the surfaces that have the same convexity and type as the seed surface should be collected.
Note
wfcSURFCOLL_ALL_GEOM_RULE, wfcSURFCOLL_CO_PLANNAR_GEOM_RULE, wfcSURFCOLL_PARALLEL_GEOM_RULE, wfcSURFCOLL_CO_AXIAL_GEOM_RULE, wfcSURFCOLL_EQ_RADIUS_GEOM_RULE, and wfcSURFCOLL_SAME_CONVEXITY_GEOM_RULE are related to wfcSURFCOLL_GEOM_RULE, that is, the geometry rule surface set.
•  wfcSURFCOLL_SHAPE_ROUND—Specifies that the surfaces with round shape should be collected. If used alone then only the primary round shapes are added to the collection set.
•  wfcSURFCOLL_SHAPE_PROTR_BOSS—Specifies that the surfaces of the boss should be collected. The protrusion surfaces with the secondary shapes are also added to the set.
•  wfcSURFCOLL_SHAPE_PROTR_RIB—Specifies that the surfaces of the rib should be collected. The protrusion surfaces without the secondary shapes are added to set.
•  wfcSURFCOLL_SHAPE_CUT_POCKET—Specifies that the surfaces of the pocket should be collected. The cut surfaces with the secondary shapes are also added to set.
•  wfcSURFCOLL_SHAPE_CUT_SLOT—Specifies that the surfaces of the slot should be collected. The cut surfaces without the secondary shapes are added to set.
•  wfcSURFCOLL_SHAPE_MORE_SHAPES—Use with wfcSURFCOLL_SHAPE_ROUND to add the secondary round shapes also.
Note
wfcSURFCOLL_SHAPE_ROUND, wfcSURFCOLL_SHAPE_PROTR_BOSS, wfcSURFCOLL_SHAPE_PROTR_RIB, wfcSURFCOLL_SHAPE_CUT_POCKET, wfcSURFCOLL_SHAPE_CUT_SLOT, and wfcSURFCOLL_SHAPE_MORE_SHAPES are related to wfcSURFCOLL_TANG_SRF, that is, the shape surface set.
•  wfcSURFCOLL_TANGENT_NEIGBOURS_ONLY—Specifies that the surfaces that have at least one tangent edge with another surface in the tangent surface set, starting from the seed surface should be collected.
Note
wfcSURFCOLL_TANGENT_NEIGBOURS_ONLY is related to wfcSURFCOLL_TANG_SRF, that is, the tangent surface set.
The method wfcSurfaceCollectionReference::Create creates a data object that contains information about the references in the surface collection instructions.
Use the methods wfcSurfaceCollectionReference::GetRefType and wfcSurfaceCollectionReference::SetRefType to get and set the type of reference contained in the surface collection reference using the enumerated data type wfcSurfaceCollectionRefType.
Surface collection references can be of the following types:
•  wfcSURFCOLL_REF_SINGLE—Specifying the collection reference belonging to the "single surface set" type of instruction. This type of reference can belong to single surface type of instruction.
•  wfcSURFCOLL_REF_SINGLE_EDGE—Specifying the collection reference belonging to the an "single surface set" edge type of instruction.
•  wfcSURFCOLL_REF_SEED—Specifying the collection reference to be the seed surface. This type of reference can belong to seed and boundary type of instruction.
•  wfcSURFCOLL_REF_SEED_EDGE—Specifying the collection reference of seed edge type. This type of reference can belong to seed and boundary type of instruction.
•  wfcSURFCOLL_REF_BND—Specifying the collection reference to be a boundary surface. This type of reference can belong to seed and boundary type of instruction.
A single seed and boundary type of instruction will have at least one of each seed and boundary type of reference.
•  wfcSURFCOLL_REF_NEIGHBOR—Specifying the collection reference to be of neighbor type. This type of reference belongs neighbor type of instruction.
•  wfcSURFCOLL_REF_NEIGHBOR_EDGE—Specifying the collection reference of neighbor edge type. This type of reference belongs to neighbor type of instruction.
A neighbor type of instruction will have one neighbor and one neighbor edge type of reference.
•  wfcSURFCOLL_REF_GENERIC—Specifying the collection reference to be of generic type. This type of reference can belong to intent surfaces , quilt and all-solid type of instructions.
Use the methods wfcSurfaceCollectionReference::GetReference and wfcSurfaceCollectionReference::SetReference to get and set the references contained in a surface collection instruction.
Use the method wfcCollectSurfacesFilter::FilterSelections to check if the current surface selection satisfies the filter criteria. The surface selection is accepted only if the method returns True.