solidworks Updating File References
solidworks Updating File References
Models and Drawings generated through DriveWorks Administrator, User or Autopilot can execute a SolidWorks macro after all of the captured parameters have been driven. There are two methods available to allow this:
Run a SolidWorks macro on all models or drawings.
Run a SolidWorks macro on a single model or drawing.
The Macro
The macro must contain a module called DriveWorks, all code within a sub-routine called Main in this module will be executed by DriveWorks.
1. Run a SolidWorks macro on all models or drawings
The macro must be located in a sub-folder of the Group Content folder called Macros. They must have the names as listed below.
There are four types of macro that can be executed:
Model.swp - will be run on all models before any individual macros have been executed
ModelAfterMacro.swp - will be run on all models after any individual macros have been executed
Drawing.swp - will be run on all drawings before any individual macros have been executed
DrawingAfterMacro.swp - will be run on all drawings after any individual macros have been executed
Information on locating the Group Content Folder can be found in General Settings
The Macros that are to be used globally must be stored in a folder called "Macros", for example, if the Group content folder is found at "C:\DriveWorks\My Project\" then the global macros folder should be found at "C:\DriveWorks\My Project\Macros"
2. Run a SolidWorks macro on a single model or drawing
The macro must be located in the same location as the master model or drawing.
The name of the macro must be the same as the master model it is to be run on, as drawings can have the same name as a model a macro to be run on a drawing must have Draw appended to the file name.
For example the SolidWorks documents:
MyAssembly.sldasm will have a macro named MyAssembly.swp
MyPart.sldprt will have a macro named MyPart.swp
MyDrawing.slddrw will have a macro named MyDrawingDraw.swp
Example
This example requires a custom property in the SolidWorks model the macro will be run on called SaveLocation. This custom property can be captured and the model will be saved to the location, with the file name and extension driven into the custom property value.
For example if the custom property SaveLocation results in the value C:\DriveWorks\Images\Project1005.jpg the model will be saved to C:\DriveWorks\Images as a .jpg image file.
Run a SolidWorks macro on all models or drawings.
Run a SolidWorks macro on a single model or drawing.
The Macro
The macro must contain a module called DriveWorks, all code within a sub-routine called Main in this module will be executed by DriveWorks.
1. Run a SolidWorks macro on all models or drawings
The macro must be located in a sub-folder of the Group Content folder called Macros. They must have the names as listed below.
There are four types of macro that can be executed:
Model.swp - will be run on all models before any individual macros have been executed
ModelAfterMacro.swp - will be run on all models after any individual macros have been executed
Drawing.swp - will be run on all drawings before any individual macros have been executed
DrawingAfterMacro.swp - will be run on all drawings after any individual macros have been executed
Information on locating the Group Content Folder can be found in General Settings
The Macros that are to be used globally must be stored in a folder called "Macros", for example, if the Group content folder is found at "C:\DriveWorks\My Project\" then the global macros folder should be found at "C:\DriveWorks\My Project\Macros"
2. Run a SolidWorks macro on a single model or drawing
The macro must be located in the same location as the master model or drawing.
The name of the macro must be the same as the master model it is to be run on, as drawings can have the same name as a model a macro to be run on a drawing must have Draw appended to the file name.
For example the SolidWorks documents:
MyAssembly.sldasm will have a macro named MyAssembly.swp
MyPart.sldprt will have a macro named MyPart.swp
MyDrawing.slddrw will have a macro named MyDrawingDraw.swp
Example
This example requires a custom property in the SolidWorks model the macro will be run on called SaveLocation. This custom property can be captured and the model will be saved to the location, with the file name and extension driven into the custom property value.
For example if the custom property SaveLocation results in the value C:\DriveWorks\Images\Project1005.jpg the model will be saved to C:\DriveWorks\Images as a .jpg image file.
buy cheap solidworks 2012 only $ 85
It is not a OEM or tryout version.
We offer worldwide shippment .
You can pay by paypal.
没有评论:
发表评论