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

Community Tip - You can subscribe to a forum, label or individual post and receive email notifications when someone posts a new topic or reply. Learn more! X

Note Positioning

Rohit
6-Contributor

Note Positioning

Hi,

We are trying to delete all the existing notes on a particular sheet of drawing and creating notes on the same sheet. On doing so, deleting the existing notes is happening. We are able to create the notes as well. But on positioning the notes based on co ordinate system is not happening correctly. Since its an automation project , we are not supposed to do anything manually, everything is to be done through coding. 

 

// Allocate and initialize the memory for a detail attachment.

status= ProDtlattachAlloc(PRO_DTLATTACHTYPE_FREE, views_flatpattern, pos, NULL, &p_attachment); // pos refers to x, y and z co ordinates. Null is being passed for proselection in the above function. May be this particular function is not being used properly

 

// Sets an attachment for the specified note.
status = ProDtlnotedataAttachmentSet(notedata, p_attachment);

 

// convert a text to notedata

ProStringToWstring(wtext, text);
ProDtlnotetextStringSet(dtl_text, wtext);

status = ProDtlnotelineTextAdd(dtl_line, dtl_text);
status = ProDtlnotedataLineAdd(notedata, dtl_line);

 

// creates note

status = ProDtlnoteShow(&note);

 

May the code for positioning of notes is not being properly written. Kindly guide us on this.

2 REPLIES 2
GabrielZaha
12-Amethyst
(To:Rohit)

I don't think is the ProDtlattachAlloc function that is creating the trouble.

What is your workflow?

Where do you connect the "notedata" structure with the "note" handle? It has to be either a call to ProDtlnoteCreate or, if the note was already created you need to use  ProDtlnoteModify

Here is an example for ProDtlnoteCreate.

/*--------------------------------------------------------------------*\
	Allocate a note description
\*--------------------------------------------------------------------*/
	status = ProDtlnotedataAlloc(drawing, &note_data);

/*--------------------------------------------------------------------*\
	Allocate a text item, and set its properties
\*--------------------------------------------------------------------*/
	ProDtlnotetextAlloc(&text);
	ProDtlnotetextHeightSet(text, -1.0);
	ProDtlnotetextWidthSet(text, -1.0);
	ProDtlnotetextSlantSet(text, 0.0);
	ProDtlnotetextThicknessSet(text, 0.0);
	ProStringToWstring(font, "font");
	ProDtlnotetextFontSet(text, font);

/*--------------------------------------------------------------------*\
 Set text lines
\*--------------------------------------------------------------------*/
	wcscpy(str,L"Sample Line 1");
	ProDtlnotetextStringSet(text, str);
	ProDtlnotelineAlloc(&line);
	ProDtlnotelineTextAdd(line, text);
	status = ProDtlnotedataLineAdd(note_data, line);
	ProDtlnotelineFree(line);

	wcscpy(str, L"Sample Line 2");
	ProDtlnotetextStringSet(text, str);
	ProDtlnotelineAlloc(&line);
	ProDtlnotelineTextAdd(line, text);
	status = ProDtlnotedataLineAdd(note_data, line);
	ProDtlnotelineFree(line);

	status = ProDtlattachAlloc(PRO_DTLATTACHTYPE_FREE, view, pos2, NULL, &attach);
	status = ProDtlnotedataAttachmentSet(note_data, attach);

/*--------------------------------------------------------------------*\
	Create the note
\*--------------------------------------------------------------------*/
	ProDtlnotedataDisplayedSet(note_data,PRO_B_TRUE);
	status = ProDtlnoteCreate(drawing, NULL, note_data, &note);
	status = ProDtlnoteShow(&note);
	status = ProWindowRefresh(PRO_VALUE_UNUSED);
	status = ProWindowRepaint(PRO_VALUE_UNUSED);

Hope this helps!

FV
17-Peridot
17-Peridot
(To:Rohit)


@Rohit wrote:

Hi,

We are trying to delete all the existing notes on a particular sheet of drawing and creating notes on the same sheet. On doing so, deleting the existing notes is happening. We are able to create the notes as well. But on positioning the notes based on co ordinate system is not happening correctly. Since its an automation project , we are not supposed to do anything manually, everything is to be done through coding. 

 

// Allocate and initialize the memory for a detail attachment.

status= ProDtlattachAlloc(PRO_DTLATTACHTYPE_FREE, views_flatpattern, pos, NULL, &p_attachment); // pos refers to x, y and z co ordinates.


Hello all,

Rohit, since you were stating that the note's position was giving you some headaches it would be beneficial to include the code related to calculation of the 'pos' variable. The most likely the transformations between part -assembly-drawing-drawing view coordinates needs to be examined...

HIH.

FV.

Top Tags