Advanced File Output (DXF, PDF, STEP)

수정된 날짜:: 1월 09,2026  
등급
다운로드: 4  
코멘트

스팩

다운로드:4
설명:"Advanced File Output" is a SolidWorks VBA macro that automates the export of a drawing and its referenced model to multiple industry-standard file formats in a single operation. When executed, it reads custom properties (Part Number, Description, and optionally Revision) from the part or assembly referenced in the active drawing, constructs standardized filenames from these properties, and exports the drawing to DWG, PDF, and DXF formats while simultaneously exporting the referenced 3D model to STEP format. The macro streamlines what would otherwise be a repetitive manual process of saving multiple file types with consistent naming conventions. It handles filename sanitization to remove illegal characters, manages DXF export preferences (setting specific version and multi-sheet options then restoring previous settings), checks for existing files to prevent accidental overwrites, and provides user feedback on the success or failure of each export operation. This is particularly useful in engineering workflows where drawings and 3D models need to be distributed to vendors, customers, or other CAD systems in standardized formats with traceable part identification in the filenames.
    전제 조건: Before running this macro, the user must have a SolidWorks drawing document (.slddrw) open and active. The macro explicitly checks the document type and displays an error message ("Open a drawing to run this macro") if a drawing is not the active document. Additionally, the drawing should reference a part or assembly model that contains custom properties - specifically "Part Number" and "Description" are required, while "Revision" is optional. The macro reads these properties from the referenced model to generate output filenames. If Part Number or Description cannot be read, the macro displays an error message ("Could not read Part Number or Description from the model"). The macro exports the drawing and its referenced model to multiple formats (DWG, PDF, STEP, and DXF), using the custom properties to construct meaningful filenames based on the part number, description, and revision.
  사후 조건: The macro generates multiple export files in the same directory as the source drawing. Specifically, it creates: - PDF file - Portable document format of the drawing - STEP file - 3D model export of the referenced part/assembly - DXF file - Drawing exchange format (with specific preferences for version and multi-sheet handling) All output filenames are constructed using the custom properties from the referenced model in the format: [Part Number], [Description] [Revision] (with revision appended only if present). The macro sanitizes these filenames by removing invalid characters (backslashes, colons, asterisks, quotes, angle brackets, pipes, and whitespace/newlines). Upon completion, the user receives a message box indicating either success ("All exports succeeded" with the list of created files) or failure (showing error and warning counts if any export failed). If export files already exist at the destination, the macro prompts the user with an overwrite confirmation dialog before proceeding.
SOLIDWORKS 버전: 2022
프로그래밍 언어: SW_VBA

 


매크로에는 바이러스나 기타 보안 위험이 있을 수 있습니다. SOLIDWORKS Corporation에서는 이 사이트에 게시된 매크로가 안전한지 그리고 신뢰할 수 있는 소스에서 왔는지 확인하지 않습니다.

SOLIDWORKS 매크로를 다운로드하십시오.

 

(로그인 필수)  

제공자
이 사용자의 다른 제공 항목

 

 

 

매크로
Zachary Kilwin

가입 날짜: 2019-10-29
제목: Product/Project Manager
 
기술:
관심:
3D printing
 
  부적절한 사용자 보고
부적절한 코멘트 보고