![]() ![]() MaterialName = "C:\Program Files\SolidWorks Corp\SolidWorks\data\graphics\Materials\metal\bronze\cast bronze.p2m" GetRayTraceRenderer(swPhotoView) 'Create material for the appearance OpenDoc6(fileName, swDocumentTypes_e.swDocPART, swOpenDocOptions_e.swOpenDocOptions_Silent, "", errors, warnings) 'Access PhotoView 360 ' * Because the model is used elsewhere, do not save changes.ĭim swModelDocExt As SldWorks.ModelDocExtensionĭim swSelectionMgr As SldWorks.SelectionMgrĭim swConfiguration As SldWorks.Configurationĭim swRenderMaterial As SldWorks.RenderMaterialĭim swRayTraceRenderer As SldWorks.RayTraceRendererĭim materialID2 As Long Sub main() Set swApp = Application.SldWorksįileName = "C:\Program Files\SolidWorks Corp\SolidWorks\samples\tutorial\tolanalyst\offset\bushing.sldprt" ' * Rendering can take several minutes to complete. Examine the Final Render and Immediate windows. ' Continue without Camera or Perspective. If prompted to use perspective views in rendering, click Gets the file names of the first appearance and surface finish Applies the specified appearance and surface finish to the model. ' * specified materials and surface-finish image exist. This example shows how to set and get the path and file name of the image used for an appearance's surface finish. ![]() Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.Get Surface-finish Image Path and File Name Example (VBA) ![]() GetOpenFilename("Text Files (*.txt), *.txt") If the user chooses a file name, the code displays that file name in a message box. This example displays the Open dialog box, with the file filter set to text files. This method may change the current drive or folder. Returns False if the user cancels the dialog box. If MultiSelect is True, the return value is an array of the selected file names (even if only one file name is selected). The returned name may include a path specification. This method returns the selected file name or the name entered by the user. If FileFilter is omitted, this argument defaults to "All Files (*.*), *.*". To use multiple MS-DOS wildcard expressions for a single file filter type, separate the wildcard expressions with semicolons for example: "Visual Basic Files (*.bas *.txt), *.bas *.txt". For example, the following string specifies two file filters-text and addin: Each separate pair is listed in the Files of type drop-down list box. This string passed in the FileFilter argument consists of pairs of file filter strings followed by the MS-DOS wildcard file filter specification, with each part and each pair separated by commas. False to allow only one file name to be selected. True to allow multiple file names to be selected. If this argument is omitted, the title is "Open." If this argument is omitted or greater than the number of filters present, the first file filter is used. Specifies the index numbers of the default file filtering criteria, from 1 to the number of filters specified in FileFilter. Parameters NameĪ string specifying file filtering criteria. GetOpenFilename ( FileFilter, FilterIndex, Title, ButtonText, MultiSelect)Įxpression A variable that represents an Application object. ![]() Displays the standard Open dialog box and gets a file name from the user without actually opening any files. ![]()
0 Comments
Leave a Reply. |