Community Tip - Visit the PTCooler (the community lounge) to get to know your fellow community members and check out some of Dale's Friday Humor posts! X
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
Solved! Go to Solution.
@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.
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.
@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.
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.