cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Did you get called away in the middle of writing a post? Don't worry you can find your unfinished post later in the Drafts section of your profile page. X

How do I get the feature ID?

CHASEONHO
18-Opal

How do I get the feature ID?

How do I get the feature ID?

I tried to get the ID of the feature as follows:

 

status = ProSelect ("prt_or_asm", 1, NULL, NULL, NULL, NULL, & proselect, & selectcount);
status = ProSelectionModelitemGet (proselect [0], & mdlitem);

feat_id = mdlitem.id


However, mdlitem.id returns an infinitely large number.(ex. 5185215)
How do I get the feature ID of a tree column?

1 ACCEPTED SOLUTION

Accepted Solutions

Try using API ProSelectionAsmcomppathGet() after getting selection object.

 

This API would give you object  ProAsmcomppath. This contains comp_id_table and table_num. comp_id_table has number of entries equal to table_num. Last entry into comp_id_table is nothing but feature ID for your selected component.

 

HIH

Ketan

View solution in original post

5 REPLIES 5

Here are the reasons I raised this question.
Use ProAsmcompAssemble and ProAsmcompConstrRedefUI to assemble the model into the toolkit.
If you select Cancel in ProAsmcompConstrRedefUI to return PRO_TK_USER_ABORT, you must delete the component that was used when assembling.
You wanted to delete the feature with ProFeatureDelete.
All features ID were obtained using ProSolidFeatstatusGet.
We deleted the most recent feature ID (the one with the highest number).
So when I use ProSolidFeatstatusGet and ProFeatureDelete to cancel component placement, it removes the components used in that assembly.

Why cant you try directly with ProFeatureDelete with handle you have with you for proasmcomp?

 

I guess it should allow as profeature and proasmcomp path is having same data structure of promodelitem.

 

I am not sure on this behaviour. If you are going to test this, please share your results.

 

-Ketan

RPN
17-Peridot
17-Peridot
(To:CHASEONHO)

extern ProError ProAsmcompAssemble ( ProAssembly   owner_assembly,

    ProSolid           component_model,

    ProMatrix           init_pos,

    ProAsmcomp *feature );

 

After you use this function, get the feature id from ProAsmcomp, this is a model item and will contain the feature id, if assembling would fail.

Try using API ProSelectionAsmcomppathGet() after getting selection object.

 

This API would give you object  ProAsmcomppath. This contains comp_id_table and table_num. comp_id_table has number of entries equal to table_num. Last entry into comp_id_table is nothing but feature ID for your selected component.

 

HIH

Ketan

ProFeatureDelete was performed with reference to the id of the ProAsmcomp object returned by ProAsmcompAssemble.
The results are very successful.

Top Tags