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

Selection object to feature in toolkit

SOLVED
Highlighted
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

Tags (2)
1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted

Re: Selection object to feature in toolkit


@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
Highlighted

Re: Selection object to feature in toolkit

ProModelitem can be directly type casted to ProFeature right ?

Highlighted

Re: Selection object to feature in toolkit

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

Highlighted

Re: Selection object to feature in toolkit


@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

Highlighted

Re: Selection object to feature in toolkit

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

Highlighted

Re: Selection object to feature in toolkit

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.

Announcements