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

Note position get

SOLVED
Highlighted
Marble

Note position get

Hi,

 

I have created notes using ProDtlNoteCreate().

How to retrieve the x and y co-ordinates of the notes created ?

 

Thanks and regards,

Sekar

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Note position get

I guess that the issue is with the null argument in ProDtlattachGet. Arguments 2-5 of ProDtlattachGet function are all output arguments and therefore they can not be NULL. They may get a NULL value after the function is called but the arguments need to be declared. It is not necessary to initialize output arguments.

Try

ProDtlattachType type;
ProVector test_loc;
ProSelection attach_point;
ProView noteView;
status = ProDtlattachGet(attachment, &type, &noteView, test_loc, &attach_point);

 After that check the values of test_loc.

View solution in original post

6 REPLIES 6

Re: Note position get

You can get this in multiple ways --  In CREOSON you simply request the following:

 

http://www.creoson.com/functions.html

 

note : get -- returns the x,y location if the model is a drawing:

Request:

{
  "sessionId": "~sessionId~",
  "command": "note",
  "function": "get",
  "data": {
    "name": "Note_2"
  }
}

Response:

{
  "status": {
    "error": false
  },
  "data": {
    "name": "Note_2",
    "value": "Another test note",
    "encoded": false,
    "location": {
      "x": 2.5,
      "y": 4,
      "z": 0
    }
  }
}

 

CREOSON is written in JLINK - so the source is out there if you want to look at the details of the request.

 

Dave

 

Re: Note position get

Hi,

Thank you so much. But I have created a toolkit application in c++. So I need a toolkit api which will help me get the X and Y co-ordinates of a note.

 

Thanks and regards,

Sekar

Re: Note position get

It's a multi step process.

First you get the ProDtlnotedata structure using ProDtlNoteDatGet.

Next you need to get the attachement using ProDtlnotedataAttachmentGet.

Last step is ProDtlattachGet function to get attachement information's. The outputs of this function are the attachement type, view, location and the attachement selection (this is the entity where the leader note is pointing at).

If your note is a free note the location vector contains the x,y coordinates. Keep in mind that you will have to apply the screen to drawing coordinates. If is a leader note then you will need to have a look at the selection output.

 

You can find an example in the TestDtlNote.c file under the <Toolkit LoadPoint>\protk_appls\pt_examples

Re: Note position get

Hi,

ProDtlNoteDatGet -  no error,

ProDtlnotedataAttachmentGet - no error;

But ProDtlattachGet  I get bad input error;

 

And yes I have created free note. 

ProDtlattach attachment;

ProDtlnote p_note;

ProDtlnotedata notedata;

status = ProDtlnoteDataGet(&p_note,NULL , PRODISPMODE_NUMERIC, &notedata);

status = ProDtlnotedataAttachmentGet(notedata, &attachment);

ProDtlattachType type = PRO_DTLATTACHTYPE_FREE;
ProVector test_loc;
test_loc[0] = 0;
test_loc[1] = 0;
test_loc[2] = 0;
ProSelection attach_point;
status = ProDtlattachGet(attachment, &type, NULL, test_loc, &attach_point);

 

Please tell me what is wrong with the code.

 

Thanks and regards,

Sekar

Re: Note position get

I guess that the issue is with the null argument in ProDtlattachGet. Arguments 2-5 of ProDtlattachGet function are all output arguments and therefore they can not be NULL. They may get a NULL value after the function is called but the arguments need to be declared. It is not necessary to initialize output arguments.

Try

ProDtlattachType type;
ProVector test_loc;
ProSelection attach_point;
ProView noteView;
status = ProDtlattachGet(attachment, &type, &noteView, test_loc, &attach_point);

 After that check the values of test_loc.

View solution in original post

Re: Note position get

Hi,

Yes it worked.

Thank you so much.

 

Announcements