Results 1 to 3 of 3

Thread: Change Tool Palette path via VBA

  1. #1
    100 Club
    Join Date
    2001-10
    Posts
    138
    Login to Give a bone
    0

    Default Change Tool Palette path via VBA

    I am currently in the process of setting up tool palettes that can be shared across a network. The problem I am having is this.

    I need to change change the tool palette extention path on everyone's machine (50+) so that they are connected to this palette library. I know in vba you can change support file paths. Can you also change the tool palette paths in a similar fashion? Ideally, I have the ACAD.lsp file loaded on everyone's machine, If I can place something there that could change the path, that would be preffered.

    I am only a beginner in the world of programming...this is why I ask.

    Marc

  2. #2
    100 Club
    Join Date
    2001-10
    Posts
    138
    Login to Give a bone
    0

    Cool Re: Change Tool Palette path via VBA

    Ok, if anyone needs this same issue resolved...I figured it out on my very own.
    The code is below.


    Option Explicit
    Public Sub PPATH()

    Dim strNewPath As String, strSetPath As String
    strNewPath = ";<your path string to add>"
    strSetPath = ThisDrawing.Application.Preferences.Files.ToolPalettePath
    strNewPath = strSetPath & strNewPath
    ThisDrawing.Application.Preferences.Files.ToolPalettePath = strNewPath
    End Sub

  3. #3
    Woo! Hoo! my 1st post
    Join Date
    2007-01
    Posts
    1
    Login to Give a bone
    0

    Default Re: Change Tool Palette path via VBA

    I have never posted a reply before but I happend to be playing with this same situation where I wanted to keep the existing path and add another one to it so this is what I came up with. It is very much like the one you wrote but this keeps the existing path and will add another path to the toolpalette paths

    Code:
    Sub ToolPalettePath()
        'This example changes the tool palette path
        Dim objPref As AcadPreferences
        Dim strSupport As String
        Dim strPath As String
        Set objPref = Application.preferences
        strSupport = objPref.Files.ToolPalettePath
        strSupport = "<COPY AND PASTE THE EXISTING PATH HERE>" _
        & ";" & "<PUT THE PATH YOU WANT TO ADD HERE>" 
    ' You can add more paths using a underscore to continue to the next line 
        
        objPref.Files.ToolPalettePath = strSupport
    End Sub
    Last edited by Opie; 2007-02-21 at 02:24 PM. Reason: [CODE] tags added

Similar Threads

  1. Replies: 0
    Last Post: 2008-08-18, 07:57 PM
  2. Change tool palette path?
    By randyspear in forum AutoCAD General
    Replies: 1
    Last Post: 2008-05-23, 03:07 PM
  3. Setting more than one tool palette path in a CUI command
    By jpaulsen in forum AutoCAD Customization
    Replies: 3
    Last Post: 2007-09-20, 02:41 PM
  4. Palette Path - Toolbar Code to change path
    By kenb in forum AutoCAD Customization
    Replies: 4
    Last Post: 2006-07-21, 03:02 AM
  5. Tool palette unpromted change
    By ssmith.62044 in forum ACA General
    Replies: 1
    Last Post: 2005-11-01, 02:00 PM

Posting Permissions

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