ds-blue-logo
Preview  |  SOLIDWORKS USER FORUM
Use your SOLIDWORKS ID or 3DEXPERIENCE ID to log in.
AMAdam Mircea07/11/2018

Hello all, i'm trying to add a note inside a block, where already exists a note.

This is what i need :

Start:

1.PNG

Result:

2.PNG

This is the code i'm testing :

'editing the block

boolstatus = swModel.Extension.SelectByID2(swFeature.Name & "-1", "SUBSKETCHINST", 0#, 0#, 0#, False, 0, Nothing, 0)

swModel.SketchManager.EditSketchBlock

'getting Note Position

pos = swNote.IGetTextPoint2

'inserting the others note

Set myNote = swModel.InsertNote("<FONT style=B><border type=9 size=0 padding=0>11</border>")

Set myAnnotation = myNote.GetAnnotation()

boolstatus = myAnnotation.SetPosition(pos(0) + 0.05, pos(1), pos(2))

Set myNote = swModel.InsertNote("<FONT style=B><border type=9 size=0 padding=0>123456789</border>")

Set myAnnotation = myNote.GetAnnotation()

boolstatus = myAnnotation.SetPosition(pos(0) + 0.05, pos(1) + 0.07, pos(2))

The problem is... that i can't understand how the position is working.
So when i'm trying to insert the new notes, the macro puts it completely away from my initial note. How can i fix this ? Have someone already seen this issue ?

Thank you for reading,

Adam.