Community Tip - Did you know you can set a signature that will be added to all your posts? Set it here! X
We created a pattern Refer to TestPatternCreate.c to create a dimension pattern for points.
We could create a reference pattern by creating a dimension pattern for a point in Creo, clicking on the coordinate system, and activating the pattern.
How can the toolkit refer to a dimension pattern created for a point and apply it to other features (or components)?
status = ProPatternCreate (& p_feature, PRO_FEAT_PATTERN, elem_tree);
>> We have created a pattern for points.
status = ProElementAlloc (PRO_E_PATTERN_ROOT, & elem_tree);
status = ProElementAlloc (PRO_E_GENPAT_TYPE, & elem_type);
status = ProElementIntegerSet (elem_type, PRO_GENPAT_REF_DRIVEN);
status = ProElemtreeElementAdd (elem_tree, NULL, elem_type);
status = ProElementAlloc (PRO_E_GENPAT_REF_TYPE, & ref1);
status = ProElementIntegerSet (ref1, PRO_PAT_FEATURE);
status = ProElemtreeElementAdd (elem_tree, NULL, ref1);
status = ProPatternCreate (& feature, PRO_FEAT_PATTERN, elem_tree);
>> The toolkit attempted to create a pattern that refers to a pattern generated for a point.
The result is failure.
Where is the problem?
Warm Regards,
SeonHo
status = ProElementAlloc(PRO_E_GENPAT_REGEN_METHOD,&elem_rgn);
status = ProElementIntegerSet(elem_rgn,PRO_PAT_VARYING);
Can be referenced by replacing existing RO_PAT_GENERA with PRO_PAT_VARYING.
Another problem occurred.
ProPatternCreate uses a ProFeature object.
How do I create a reference pattern for ProMdl?
Warm Regards,
SeonHo
// Create the Tree
status = ProElementAlloc (PRO_E_PATTERN_ROOT, &elem_tree);
status = ProElementAlloc (PRO_E_GENPAT_REF, &elem_type);
status = ProElementIntegerSet (elem_type,PRO_PAT_FEATURE);
status = ProElemtreeElementAdd (elem_tree,NULL,elem_type);
// Init the feature by ID
tk_status = ProFeatureInit( model , feat_id , &feature );
tk_status = ProPatternCreate(&feature,PRO_FEAT_PATTERN,elem_tree);
// as far I know, thats it
//In tcl (simple function)
ps_feat refpattern -model ?Model? ListOfFeatureIDs