Community Tip - When posting, your subject should be specific and summarize your question. Here are some additional tips on asking a great question. X
Hello
We need to highlight specific dimension from sketch of extrude. How to highlight the same?
If we go through feature dimension visit, ProFeatureDimensionVisit() we can get dimension handle which can be converted to selection and then we can use ProSelectionHighlight(). Issue with this approach is the identification of dimension type. Whether dimension is section dimension or not.
Another way is to get section from feature using ProFeatureSectionCopy(). Post this, we can get section Dimension IDs using ProSecdimIdsGet(). But here we are not able to get handler of section dimension to convert it to selection object to highlight the same.
Any thought would be of great help.
We are having Creo 4.0 M030.
Feel free to ask for any clarification.
Regards
Ketan
I am still unable to find a way ahead for this. Any hint would also be helpful.
ProSectionDimensionIdsGet
that I already used. How to get selection of dimension handler? Sec dimension ID is only available, not dimension handler.
ProSectionDimensionIdsGet will return only the section dims, not additional ones.
sec solid
1 30
3 32
4 34
5 35
by Feature
30 32 34 35 and 28 for a specified height
On ProDimensionVisitAction you can match this to sec ID, because you have the handle.
For show i still use ProDimensionShow/ProDimensionErase
Yes, I got dimension handler.
Converted to model item and then to selection object. Post that, selection highlight does not highlight section dimension.
Any idea on how to make section dimension highlighted like we highlight feature using selection highlight API?
@Ketan_Lalcheta wrote:
Yes, I got dimension handler.
Converted to model item and then to selection object. Post that, selection highlight does not highlight section dimension.
Any idea on how to make section dimension highlighted like we highlight feature using selection highlight API?
Hi all,
Ketan,
you are getting section handle either by extracting PRO_E_STD_SECTION element from elemtree or using ProFeatureSectionCopy. In either case the extracted section handle points to a 'clone' of the actual section used by a feature. You could convert somehow the handle to ProMdl and retrieve a 2D-section model into an object window and to try highlight section dimensions there...
ProSectionDimensionIdsGet will get you a mapping between feature dimensions which could be selected/highlighted and so on and underlying section dimensions which could be manipulated by your code.
The workflow is - select feature, show dimensions, select a dimension, get the corresponding section dimension id, get a copy of the section, do something with the section dimension in question in the code, update section, modify element tree with updated section, regenerate feature.
HIH.
FV.
HIH.
FV.
sounds good. Let me give a try on this.
Why do you can't use ProDimensionShow/ProDimensionErase as mentioned?
We don't want dimension to be displayed into model. Dimension need to be selected by application. More ever, I gave a try to use this API related to annotation show. But it seems to have bad input.
Additionally, Feature dimension ID and section dimension ID does not remain same.Attached is sample case I come across. You may like to check section dimension IDs for feature Extrude 2 of PRT0003.prt. To say in other words, section dim ID is zero present into feature (Extrude 2) ID 131 of PRT0003.prt.
Now if you open assembly, go to model PRT0003.prt and identify feature handle for feature ID 131. Visiting this feature's dimension ID, you may end up with dimension ID 10 and 9. But you cannot identify dimension ID 0.
# Copy! the first section by FeatID and SecNum ps_feat section 131 0 secObj # get the mapping secObj sec2soliddimids -> 0 10 -> The section has only one dim, section ID 0 will map to model dim id 10
It's a feature, so there is no diff between part mode or assembly mode. I will get always '0 10'
And for sure you cant modify the section dim, because I copied the section from the model, but you can modify dim id 10 or 9. And this ids are equal. no difference between modes.
# Get dimensions by feature ID ps_dim by 131 # This will return the handles -> {::PS::PRT0003.PRT.DIM.D10 ::PS::PRT0003.PRT.DIM.D9} # ::PS::PRT0003.PRT.DIM.D9 is the feature thickness
Note: You can use the ProSelection for highlight, but for a permanent display you need a different function. If your select use "dimension" the dimension must be already displayed. For "feature, dimensions" you need to display the dimensions if the user picks a feature.
I am doing code to highlight weak dimension of sketch. So, I just wanna highlight it.
Another query is related to dimension ID mapping.
ProSecdimIdsGet() gives one dimension ID that is 0.
ProFeatureDimensionVisit() gives two dimensions ID 10 and 9.
How you come to know that 0 is mapped to 10 only? This is the case of one section dimension ID. In case of more dimensions into section, how to do mapping?
Dim ID 9 ist not Part of the section IDs, so this dim is probably the thickness of the protrusion, or something like this.
ProError tk_status; ProIntlist sec_dim_id_list; ProIntlist solid_dim_id_list; int num_ids = -1; int i; tk_status = ProSectionDimensionIdsGet(SECTION, &sec_dim_id_list, &solid_dim_id_list, &num_ids); for ( i = 0 ; i < num_ids ; i++ ) { ..... sec_dim_id_list[i]); ..... solid_dim_id_list[i]); }
ProSectionDimensionIdsGet() returns both, so here you have secDims and solidDims at the same array IDX.
Do you mean to say that compare first with first , second with second and ignore rest all dimension ID of features?
To conclude, we cannot have both ID same (0 to 0 and 1 to 1) , but only need to compare with first with first and so on? How long this assumption is valid?
Yes, at the end you can ignore the Feature Dim List, you need only the mapping. Check the section dim and highlite the modeldim at the same position.
If num of ids is 8 then for the 7th ID (0,1,2,3,4,5,6) secdim[6]=0 is modeldim[6]=27