Hello
I currently have two macros that I would like to upgrade.
The 1st saves the camera view (which must be activated) in jpeg in the directory where the document is located by adding information to the name of the file (date, camera name, and file name)
The second macro does the same thing, but for all the cameras in the document. very practical when you have 10 cameras.
I would have liked macros to be able to store my JPEGs in a JPEG directory (so create a JPEG directory if it doesn't exist) in the same place as the part.
The goal is to tidy up a little, and not to have the images in the same place as all the solidworks documents.
Am I clear??
In short, I can't create the directory in my macro. For your information, it was our computer scientist who tinkered with these macros and he is no longer there.
Thank you for your help.
In pjh the two macros (You can use them if needed)
toutes_camera_vers_jpeg.swp
Try to integrate in your macros:
Where there are all the dim
Dim Swapp As sldWorks.SldWorks, swModel As SldWorks.ModelDoc2
Before "Get the camera"
Set swApp = Application.SldWorks: Set swModel = swApp.ActiveDoc
And instead of
myBool = swApp.RunMacro("D:\Solidworks\Macro\Camera to JPEG.swp", "Save_as_jpeg1", "Main")
to put
myBool = swApp.RunMacro("swModel.GetPathName", "Save_as_jpeg1", "Main")
You'll tell me if it works. Since I don't use a camera, I can't check it at home
On the other hand, what surprises me is that your 2nd macro should be in the same repertoire as the one in your room.
Or is there a line that escapes me in understanding?
thank you coin coin
I'm going to test it!
Indeed it is:
On the other hand, what surprises me is that your 2nd macro should be in the same repertoire as the one in your room.
Or is there a line that escapes me in understanding?
I finally found the solution, well rather a computer scientist friend who found it..
If this interests the solution in the PC
camera_vers_jpeg.swp
I finally found the solution, well rather a computer scientist friend who found it..