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

Community Tip - Your Friends List is a way to easily have access to the community members that you interact with the most! 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

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.

Announcements


Top Tags