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

Community Tip - Help us improve the PTC Community by taking this short Community Survey! X

Selection object to feature in toolkit

Ketan_Lalcheta
19-Tanzanite

Selection object to feature in toolkit

Hello

 

I have selection object chosen from user using API proselect(). Here, user is allowed to select csys only. What I need is feature handle for this csys. For the same, I am doing selection to modelitem ProSelectionModelitemGet() and on this model item, I am doing geom item to csys with API ProGeomitemToCsys(). Now with procsys, I am not able to directly use it as profeature.

Is there any other way or I am missing something to get feature handle from selection object?

 

Thanks and Regards

Ketan

1 ACCEPTED SOLUTION

Accepted Solutions
FV
17-Peridot
17-Peridot
(To:Ketan_Lalcheta)


@Ketan_Lalcheta wrote:

Hello

 

I have selection object chosen from user using API proselect(). Here, user is allowed to select csys only. What I need is feature handle for this csys. For the same, I am doing selection to modelitem ProSelectionModelitemGet() and on this model item, I am doing geom item to csys with API ProGeomitemToCsys(). Now with procsys, I am not able to directly use it as profeature.

Is there any other way or I am missing something to get feature handle from selection object?

 

Thanks and Regards

Ketan


Hi all,

Ketan, do not cast... The Pro/Toolkit way is:

ProSelectionModelitemGet(…) ;

if( PRO_FEATURE != mi.type)  { ProGeomitemFeatureGet(…);}

HIH.

FV.

View solution in original post

5 REPLIES 5

ProModelitem can be directly type casted to ProFeature right ?

Yes that is what I tried first as both are having same structure, but direct type cast failed.

FV
17-Peridot
17-Peridot
(To:Ketan_Lalcheta)


@Ketan_Lalcheta wrote:

Hello

 

I have selection object chosen from user using API proselect(). Here, user is allowed to select csys only. What I need is feature handle for this csys. For the same, I am doing selection to modelitem ProSelectionModelitemGet() and on this model item, I am doing geom item to csys with API ProGeomitemToCsys(). Now with procsys, I am not able to directly use it as profeature.

Is there any other way or I am missing something to get feature handle from selection object?

 

Thanks and Regards

Ketan


Hi all,

Ketan, do not cast... The Pro/Toolkit way is:

ProSelectionModelitemGet(…) ;

if( PRO_FEATURE != mi.type)  { ProGeomitemFeatureGet(…);}

HIH.

FV.

Or select a feature and use the filter function to validate that a csys was selected.

Hi @Ketan_Lalcheta

 

Using API ProSelect(),setting select filter as "csys",then change selection to modelitem by ProSelectionModelitemGet() .

Now, you get :

modelitem's type is PRO_CSYS,

modelitem's ID is "Geometry ID"

But, Feature Id not equal to Geometry Id.

So, you can't cast it directly.

 

if you want the Feature handle.

After doing ProSelectionModelitemGet(), just using ProGeomitemFeatureGet().

then you can get the Feature handle which construct the csys.

Top Tags