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

J-Link. Set the name for drawing note

SOLVED
Newbie

J-Link. Set the name for drawing note

Hello!

ModelItem.SetName return exception XToolkitBadInputs.

DetailNoteItem note = (DetailNoteItem) drawing.CreateDetailItem(instrs);ModelItem itm = (ModelItem) note;

itm.SetName("note_test");


Any ideas?

I would be grateful for any help!

Tags (3)
1 ACCEPTED SOLUTION

Accepted Solutions

Re: J-Link. Set the name for drawing note

Hello, Mark!

Thank you for help!

Unfortunatly, it is a bug in API. ProModelitemNameSet() API returns PRO_TK_BAD_INPUTS (-2) while setting name to a detail note.

View solution in original post

2 REPLIES 2

Re: J-Link. Set the name for drawing note

Hi -

I can't say for sure what caused your error, but you should find it easier to isolate the problem if you did not cast the original object to different types.

DetailNoteItem note = (DetailNoteItem) drawing.CreateDetailItem(instrs);ModelItem itm = (ModelItem) note;

itm.SetName("note_test");

Try this instead:

     DetailItem item = drawing.CreateDetailItem( instrs ) ;

     item.SetName( "note_test" ) ;

DetailItem is a subclass of ModelItem, so a DetailItem object can execute any method that a ModelItem can.

Also, are you certain that ModelItem.SetName is throwing the exception and not Drawing.CreateDetailItem ?

|+|  M a r k  |+|

Re: J-Link. Set the name for drawing note

Hello, Mark!

Thank you for help!

Unfortunatly, it is a bug in API. ProModelitemNameSet() API returns PRO_TK_BAD_INPUTS (-2) while setting name to a detail note.

View solution in original post