Hello
I'm working in solidworks 2011, I already have a macro that saves me my active plan, the plan of my active part or all the plans of the active assembly, all in the right location.
This macro simply uses the "save as" function in PDF format from solidworks (no virtual printers such as Bullzip or PDFcréator!)
My problem is that I would like to make a text appear in my basemap with "FOR CONSULTATION" written if I want to when launching my PDF macro.
First of all, I thought of creating an angled block with the right font, the right size, and I tried to add it to my background by macro. The problem is that, since there are several plan formats to different formats, the inserted block position as well as the size is not the easiest to manage.
I then thought of simply making a note on my basemap (already well positioned and at the right size) and simply having it displayed and then hidden when running my macro if I decide that this version of the plan will be only for consultation.
With a recording I manage to hide my text box:
Sub main()
Set swApp = _
Application.SldWorks
Set Part = swApp.ActiveDoc
boolstatus = Part.Extension.SelectByID2("Plan détail1988@Fond object", "NOTE", 0.2884716463644, 0.1501347778362, 0, False, 0, Nothing, 0)
Part.HideDimension
End Sub
It works well and this piece of code gives me the ID of my text box at the same time. This allows me to write another piece of code to reselect my note.
On the other hand, no matter how hard I look, I can't find the function that allows me to redisplay this note!!!!
The selection of the note leads me to another question:
How do I control the ID of an object? because depending on my different baselines, the ID of my note will probably not always be the same (Object of détail1988@Fond of plan" in my example above)
Sorry, I may be asking basic questions in VBA SolidWorks but I've been doing them for a very short time.
Thanks in advance!
Yves