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

Highlight section dimension using protoolkit

Highlight section dimension using protoolkit

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

15 REPLIES 15

Re: Highlight section dimension using protoolkit

I am still unable to find a way ahead for this. Any hint would also be helpful.

Re: Highlight section dimension using protoolkit

ProSectionDimensionIdsGet

Re: Highlight section dimension using protoolkit

that I already used. How to get selection of dimension handler? Sec dimension ID is only available, not dimension handler.

Re: Highlight section dimension using protoolkit

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

Re: Highlight section dimension using protoolkit

I never thought dimension id remains same even if we get it through section or feature.....if this is so, It would be easy to implement this...

Thanks for sharing this information....

Re: Highlight section dimension using protoolkit

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?

Re: Highlight section dimension using protoolkit


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

Re: Highlight section dimension using protoolkit

Why do you can't use ProDimensionShow/ProDimensionErase as mentioned?

Re: Highlight section dimension using protoolkit

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.