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

Re: Highlight section dimension using protoolkit

sounds good. Let me give a try on this.

Re: Highlight section dimension using protoolkit

RPN_DocPic_00268.pngRPN_DocPic_00267.png

 

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

Re: Highlight section dimension using protoolkit

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?

Re: Highlight section dimension using protoolkit

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.

Re: Highlight section dimension using protoolkit

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? 

Re: Highlight section dimension using protoolkit

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