In a drawing, I would like to create a macro that fills me a note with the custom parameter named 'Product Code' of the selected part.
I know how to construct the macro for creating and filling the note, but I don't know how to interrupt the macro to ask the user to select an edge or surface to attach the note to.
Anyone have any info or a link that could be useful to me?
You can put a simple msgBox with a message like "Please select the entity .... before validating this message." and then retrieve the entity selected in your macro by the GetSelectedObject6 function.
Sorry for the previous post, it doesn't work. On the other hand, you can do:
Dim SelMgr As SelectionMgr
Set SelMgr = Part.SelectionManager
Set Feature = SelMgr.GetSelectedObject6(1, 0)
Do While Feature Is Nothing
DoEvents
Set Feature = SelMgr.GetSelectedObject6(1, 0)
Loop
This allows the macro to be put on hold until an item is selected.