I have a questions regarding get notes on SW drawings from excel cell. I have recorded a macro to add a note in the SW drawings (see below).
Basically; I want to update the....Set Note = Part.InsertNote("HU987456")....
be taken from excel "Sheet Test" cell "D1". For example, if I type in the Sheet Test, cell "D1" WR65478. I want this information get in my drawing when the macro runs.
Could you please let me know if is possible to do it?
Thanks in advance.
Maperalia
'### Start Macro #####
Sub Note()
Dim swApp As Object
Dim Part As Object
Dim boolstatus As Boolean
Dim longstatus As Long, longwarnings As Long
Dim FeatureData As Object
Dim Feature As Object
Dim Component As Object
Dim Note As Object
Dim Annotation As Object
Dim TextFormat As Object
Set swApp = Application.SldWorks
Set Part = swApp.ActiveDoc
boolstatus = Part.Extension.SelectByID("Sheet1", "SHEET", 0.07389519540958, 0.1025964662951, 0, False, 0, Nothing)
Part.EditTemplate
Part.EditSketch
boolstatus = Part.Extension.SelectByID("Revision Table Anchor", "BOMTEMP", 0, 0, 0, False, 0, Nothing)
Set Note = Part.InsertNote("HU987456")
If Not Note Is Nothing Then
Note.Angle = 0
boolstatus = Note.SetBalloon(0, 0)
Set Annotation = Note.GetAnnotation()
If Not Annotation Is Nothing Then
longstatus = Annotation.SetLeader2(False, 0, True, True, False, False)
boolstatus = Annotation.SetPosition(0.1583153968128, 0.09275491145937, 0)
boolstatus = Annotation.SetTextFormat(10, True, TextFormat)
End If
End If
Part.ClearSelection2 True
Part.WindowRedraw
boolstatus = Part.Extension.SelectByID("Sheet Format1", "SHEET", 0.1020137934272, 0.1451902159624, 0, False, 0, Nothing)
Part.EditSheet
Part.EditSketch
End Sub
'### End Macro #####