Reply
Solved! Go to solution

Dimension text location point

[ Edited ]

I am trying to retrieve the location - start and end points - and preferably the Range of just the Text part of a dimension in Draft:

objDim.GetKeyPoint(1, x, y, z, SolidEdgeFramework.KeyPointType.igKeyPointCenter, 1)

 

I tried the first argument index with values 1 and 0 and the last argument HandleType also 1 and 0 with no knowledge about what they actually mean. Also tried out various KeyPointTypes but could get any close.

 

What would be the Index or Keypoint values to be used to retrieve the text position ?

Is GetKeyPoint even the correct function to use for getting the text location?

 

Any help is highly appreciated.

 

~Tushar

 

9 REPLIES

Re: Dimension text location point

Tushar,

 

you may use Dimension.Range(...) to get returned the coordinates for xmin, ymin, xmax, ymax of the Dimension object in total (surrounding virtual box).

 

Dimension.GetKeyPoint(...) sounds a bit confusing. This method returns the values for the specified keypoint index given as first argument.

Dimension.KeyPointCount gives you the count of available keypoints. In a loop over all indices available (0 to KeyPointCount -1) you can get so the information for all keypoints. The return values for KeyPointType and HandleType let you identify the keypoints.

 

Kind regards,
Wolfgang Kunert - www.wksyspro.de
Solution
Solution
Accepted by topic author Tushar
‎10-08-2015 02:30 AM

Re: Dimension text location point

[ Edited ]

Tushar,

 

Dimension.GetDisplayData.GetTextAtIndex (...) might give the information needed.

The API help to this method also does contain an usefull example.

 

 

 

Kind regards,
Wolfgang Kunert - www.wksyspro.de

Re: Dimension text location point

[ Edited ]

Awesome !

Dimension.GetDisplayData.GetTextAtIndex works.

I would have never imagined GetTextAtIndex returning any 'position' coordinates  Man Surprised

So did not make the effort to explore it deeper.

 

Thanks a lot Wolfgang !!

 

~Tushar Suradkar

 

Re: Dimension text location point


wku wrote:

The API help to this method also does contain an usefull example.

 

 


Wolfgang, can you please share the link to the API help. Local CHM help from the SDK folder does not have an example for GetTextAtIndex.

 

Thanks,

Tushar

Re: Dimension text location point

Tushar,

 

see the local chm help file of SDK ST7/ST8:

 

Kind regards,
Wolfgang Kunert - www.wksyspro.de

Re: Dimension text location point

There lies the problem.

I am on ST 6 which does not have a sample for this method in the local SDK.

I believe there is always an equivalent online version of the SDK help but not able to find it online.

 

Thanks again Wolfgang.

 

~Tushar

Re: Dimension text location point

OK, found it.

Googled for GetTextAtIndex and found the ST6 version.

Changed the 106 in address to 107 and it worked:

 

http://support.industrysoftware.automation.siemens.com/training/se/107/api/SolidEdgeFrameworkSupport...

 

Has the sample too.

 

Re: Dimension text location point

Tushar,

 

there is also a link to the online version of the API help from the Solid Edge Developer Community home page. But still only for ST7 and not for ST8 Smiley Surprised

Kind regards,
Wolfgang Kunert - www.wksyspro.de

Re: Dimension text location point

Hello! sir

By this method only the Location of the Dimension text is retrieved but how to set the location of the dimension text?

My problem is I have created a drawing with all the dimension placed at required distance. As the Size of the Model increases, I change the scale appropriately and also the dimension text scale. But while doing so some of the dimensions are getting overlapped in the view. I tried to set the track distance but track distance is not changing consistently as per the change in scale so I can't predict the track distance.

is there any better way to handle this please let me know.