Protoolkit Example 3: traverse all feature values in the Model

Source: Internet
Author: User

Pro/E is a feature-based 3D software.

Each item in the model tree is a feature. As shown in

The following program implements traversal of the feature under the current model of proe, with code:

Proerror _ visitsolidallfeats _ (profeature * p_feature, proerror status, proappdata app_data) {proarrayobjectadd (proarray *) app_data,-1, 1, p_feature); Return pro_tk_no_error ;} int test (uicmd1_id command, uicmdvalue * p_value, void * p_push_command_data) {proerror err; promdl MDL; // get the current model handle err = promdlcurrentget (& MDL); If (then! = ERR) Return-1; // defines the array variables, used to record all profeature proarray arr; proarrayalloc (0, sizeof (profeature), 10, & ARR ); // The variable accesses all feature prosolidfeatvisit (prosolid) MDL, _ visitsolidallfeats _, null, & ARR) in the current model; // The ID int nsize of all profeature values in the output array; proarraysizeget (ARR, & nsize); cstring CSTR; CSTR. format (text ("% d feature in total"), nsize); afxmessagebox (CSTR); For (INT I = 0; I <nsize; ++ I) {int id = (profeature *) Arr) [I]. ID; CSTR. format (text ("feature id = % d"), ID); afxmessagebox (CSTR);} // release the array resource proarrayfree (& ARR); Return 0 ;}

Download the source code vs2005 + proe3.0
Http://download.csdn.net/detail/wangyao1052/4945338

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.