Results 1 to 2 of 2

Thread: VBA code - Open all autocad files from a folder do some standard changes and save file to the new folder

  1. #1
    Woo! Hoo! my 1st post
    Join Date
    2015-02
    Posts
    1
    Login to Give a bone
    0

    Default VBA code - Open all autocad files from a folder do some standard changes and save file to the new folder

    Hi,

    I am using AutoCAD 2015. I have a requirement where i have more than 500 AutoCAD files (.DWG) which are kept in the folders in a structured manner (Multiple folder under one folder). I want to do some font changes (same for all file) to all files and want to save the file. I have seen some code which do the same thing for .DXF but i haven't found anything for .DWG.
    Can someone please help me with a VBA code where all these ativities can be done on one click? I have the code to do font changes as mentioned below which can be applied to each file. Please let me know if more information needed.

    Thank in advance for the help. Your help is greatly appreciated.
    Code:
    Public Sub ChangeFonts()
        Dim TextFont As AcadTextStyle
        For Each TextFont In ThisDrawing.TextStyles
        TextFont.fontFile = "C:\Windows\Fonts\Romans.shx"
        TextFont.Height = "0.8"
        TextFont.Width = "0.75"
        TextFont.ObliqueAngle = "0"
      Next TextFont
    ThisDrawing.Regen acAllViewports
    End Sub
    Last edited by BlackBox; 2015-07-15 at 02:08 PM. Reason: Please use [CODE] Tags

  2. #2
    Administrator Ed Jobe's Avatar
    Join Date
    2000-11
    Location
    Turlock, CA
    Posts
    5,680
    Login to Give a bone
    0

    Default Re: VBA code - Open all autocad files from a folder do some standard changes and save file to the new folder

    I recommend using ScriptPro to run a script on the files. It takes care of handling the files. You can download it here. Then all you need is a script. You write that in Notepad. You can use the VBARUN command to call your sub.
    C:> ED WORKING....

Similar Threads

  1. Replies: 13
    Last Post: 2018-03-13, 12:52 AM
  2. Options for folder to save to, open from, or insert from.
    By Wish List System in forum AutoCAD Wish List
    Replies: 3
    Last Post: 2013-03-11, 06:47 PM
  3. 2013: OPEN / SAVE FOLDER DEFAULT
    By geeare in forum AutoCAD Civil 3D - General
    Replies: 1
    Last Post: 2013-01-16, 01:51 PM
  4. Does anyone have a standard folder structure to organize cad files?
    By pmedina in forum CAD Management - General
    Replies: 12
    Last Post: 2007-05-02, 07:49 AM
  5. Add folder in file open/save
    By Andrew Dobson in forum Revit Architecture - General
    Replies: 3
    Last Post: 2006-08-07, 01:27 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •