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

Community Tip - If community subscription notifications are filling up your inbox you can set up a daily digest and get all your notifications in a single email. X

JLink - positioning notes

GaryHoffman
1-Newbie

JLink - positioning notes

I'm attempting to insert notes onto a drawing. Searching throught the API docs, I'm having trouble finding the methods needed to position the notes. I'm using

DetailText text = pfcDetail.DetailText_Create ("my note");
DetailTexts texts = DetailTexts.create();
texts.insert (0, text );
DetailTextLine textLine = pfcDetail.DetailTextLine_Create (texts);
DetailNoteInstructions instrs =
pfcDetail.DetailNoteInstructions_Create (textLines);
DetailNoteItem note =
(DetailNoteItem) drawing.CreateDetailItem (instrs);
note.Show ();

This will insert a note at the origin of the drawing, but I need to position the notes in specific locations.
The DetailNoteInstructions interface does not have any methods for locating the note text. I'm guessing that I need to get other classes/interfaces involved. I'm starting to look at other interfaces in the pfcDetail package like DetailCreateInstructions and DetailEntityInstructions, but I'm uncertain how they all work together.

Any help pointing me in the right direction would be appreciated.
thanks,
Gary Hoffman
Solar Turbines Incorporated


2 REPLIES 2


> I'm attempting to insert notes onto a drawing. Searching throught the API docs, I'm having
> trouble finding the methods needed to position the notes. I'm using
>
> DetailText text = pfcDetail.DetailText_Create ("my note");
> DetailTexts texts = DetailTexts.create();
> texts.insert (0, text );
> DetailTextLine textLine = pfcDetail.DetailTextLine_Create (texts);
> DetailNoteInstructions instrs =
> pfcDetail.DetailNoteInstructions_Create (textLines);
> DetailNoteItem note =
> (DetailNoteItem) drawing.CreateDetailItem (instrs);
> note.Show ();
>
> This will insert a note at the origin of the drawing, but I need to position the notes in specific
> locations. The DetailNoteInstructions interface does not have any methods for locating the note
> text. I'm guessing that I need to get other classes/interfaces involved. I'm starting to look at
> other interfaces in the pfcDetail package like DetailCreateInstructions and DetailEntityInstructions,
> but I'm uncertain how they all work together.


I'm fairly certain you do this with the SetLeader() method of your DetailNoteInstructions
object. This allows you to define an attachment which will be either a FreeAttachment or
ParametricAttachment.


I had a Japanese user asking about location for symbols in Pro/WebLink. Had to utilize a
similar methodology but using InstAttachment property, which returns a DetailLeaders object.
Not something you'd expect to look for, if not using leaders or special attachments.



Marc
--
Marc Mettes
-
Visit My CAD/PDM AutomationBlog
Or, Subscribe to My CAD/PDM Automation Blog by Email







Thanks Marc and everyone else who responded. The solution was to create a FreeAttachment and SetLeaders() even though my note didn't have any. I just inserted the following...

FreeAttachment freeAttachment = pfcDetail.FreeAttachment_Create(pointLoc);
freeAttachment.SetView(view);
DetailLeaders dls = pfcDetail.DetailLeaders_Create();
dls.SetItemAttachment(freeAttachment);
dls.SetLeaders(null);
instrs.SetLeader(dls);
instrs.SetIsDisplayed(Boolean.TRUE);

thanks,

Gary


In Reply to:


> I'm attempting to insert notes onto a drawing. Searching throught the API docs, I'm having
> trouble finding the methods needed to position the notes. I'm using
>
> DetailText text = pfcDetail.DetailText_Create ("my note");
> DetailTexts texts = DetailTexts.create();
> texts.insert (0, text );
> DetailTextLine textLine = pfcDetail.DetailTextLine_Create (texts);
> DetailNoteInstructions instrs =
> pfcDetail.DetailNoteInstructions_Create (textLines);
> DetailNoteItem note =
> (DetailNoteItem) drawing.CreateDetailItem (instrs);
> note.Show ();
>
> This will insert a note at the origin of the drawing, but I need to position the notes in specific
> locations. The DetailNoteInstructions interface does not have any methods for locating the note
> text. I'm guessing that I need to get other classes/interfaces involved. I'm starting to look at
> other interfaces in the pfcDetail package like DetailCreateInstructions and DetailEntityInstructions,
> but I'm uncertain how they all work together.


I'm fairly certain you do this with the SetLeader() method of your DetailNoteInstructions
object. This allows you to define an attachment which will be either a FreeAttachment or
ParametricAttachment.


I had a Japanese user asking about location for symbols in Pro/WebLink. Had to utilize a
similar methodology but using InstAttachment property, which returns a DetailLeaders object.
Not something you'd expect to look for, if not using leaders or special attachments.



Marc
--
Marc Mettes
-
Visit My CAD/PDM AutomationBlog
Or, Subscribe to My CAD/PDM Automation Blog by Email