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

Community Tip - Stay updated on what is happening on the PTC Community by subscribing to PTC Community Announcements. X

How to get location of the dimension in the drawing

ngothankar
1-Newbie

How to get location of the dimension in the drawing

Hi,

I am trying to get model's dimension location in drawing.

I am using ProDimensionLocationGet () and ProDimlocationTextGet() APIs but the location I am getting I am not able to match wrt to drawing coordinate.

do we need to process the point3d position again in order to conver it in drawing CSYS?i

Thanks in advance

Nikhil


This thread is inactive and closed by the PTC Community Management Team. If you would like to provide a reply and re-open this thread, please notify the moderator and reference the thread. You may also use "Start a topic" button to ask a new question. Please be sure to include what version of the PTC product you are using so another community member knowledgeable about your version may be able to assist.
1 ACCEPTED SOLUTION

Accepted Solutions
mender
6-Contributor
(To:ngothankar)

177,126 is in world coordinates, to judge by the picture.  You can transform that into drawing units with the trf matrix from ProDrawingSheetTrfGet.

View solution in original post

7 REPLIES 7

Can you draw a simple example of your expected result please?

Nikhil -

I haven't yet used ProDimensionLocationGet or ProDimlocationTextGet, but I'll see if I can help just the same.


the location I am getting I am not able to match wrt to drawing coordinate.


What kind of coordinates are you getting?  Are they even close?


The documentation for ProDimlocationTextGet states that it returns the location in "model coordinates". That should be the coordinates of your drawing. If the coordinates are wrong, but close, try changing the value of ProDimlocationTextGet's has_elbow argument.

If the coordinates make no sense to you at all, I suggest that you open a support call with PTC.

Good luck with this.

|+|  M a r k  |+|


Hello Nikhil,

Try ProDrawingDimensionPosGet API.

Regards

Ketan

Hi,

I have created a 100x100x100 mm solid part and paced it on C size drawing sheet with 1 vertex at 0,0 position.

here the coordinate of a point placed on dimension 100 on vertical edge (behind X).

Now how to justify 177,126 as location of dim 100?

Both ProDrawingDimensionPosGet() &  ProDimlocationTextGet(), returning same value of point3d.

Thanks

Nikhil

mender
6-Contributor
(To:ngothankar)

177,126 is in world coordinates, to judge by the picture.  You can transform that into drawing units with the trf matrix from ProDrawingSheetTrfGet.

Hi,

Thanks every one for your effort and suggestions.

toolkit APIs return screen coordinate information, we need to transform it in to drawing sheet coordinate.

use ProDimlocationTextGet to get location of dimension coordinate and use following method can be used to achieve this.

void UserScreenToDwg (ProDrawing drawing,ProPoint3d scn_point,ProPoint3d drw_point) {

  ProName    w_size;

ProMatrix  matrix;

int cur_sheet;

ProError err;

err = ProDrawingCurrentSheetGet(drawing, &cur_sheet);

err = ProDrawingSheetTrfGet(drawing, cur_sheet, w_size, matrix);

err = ProPntTrfEval(scn_point, matrix, drw_point);

}

Nikhil -

I'm glad you were able to resolve this problem. If your solution is the correct one, then please report to PTC that the documentation for ProDimlocationTextGet is incorrect.  Here's how it describes the output parameter pnt on Creo Parametric 3.0 M050:

The location, in model coordinates, of the dimension text (if has_elbow is PRO_B_FALSE) or the elbow joint (if has_elbow is PRO_B_TRUE). Pass NULL when not required.

Given your findings, the above sentence should read "The location, in screen coordinates ..."

|+|  M a r k  |+|

Top Tags