See the top rated post in this thread. Click here

Page 1 of 2 12 LastLast
Results 1 to 10 of 16

Thread: tool palettes and lisp routine

  1. #1
    100 Club Matt Mercer's Avatar
    Join Date
    2004-05
    Location
    Liberty Lake, WA
    Posts
    147
    Login to Give a bone
    0

    Cool tool palettes and lisp routine

    A question I have is: I have created lisp routine that switches layers on and off. I work in an architectural firm. For example main floor is "mp" and upper floor is "up" in the lisp routines. I have created main floor palette and an upper floor palette for different blocks . When I hit "mp" I would like the mainfloor palette to load automatically. When I hit "up" for the upper floor then it automatically switches to the upper floor palette. Is there a command to load tool palettes and unload? Thanks for any help Matt

  2. #2
    I could stop if I wanted to msretenovic's Avatar
    Join Date
    2002-02
    Location
    Galloway, Oh
    Posts
    305
    Login to Give a bone
    0

    Lightbulb Re: tool palettes and lisp routine

    Quote Originally Posted by MATT_MERCER_2000
    A question I have is: I have created lisp routine that switches layers on and off. I work in an architectural firm. For example main floor is "mp" and upper floor is "up" in the lisp routines. I have created main floor palette and an upper floor palette for different blocks . When I hit "mp" I would like the mainfloor palette to load automatically. When I hit "up" for the upper floor then it automatically switches to the upper floor palette. Is there a command to load tool palettes and unload? Thanks for any help Matt
    Matt,
    To change tool pallettes, you will need to put them into seperate directories and change the directory path. When you change the path, the tool pallette will update itself. Here is the VLisp way to change the directory:
    Code:
    (setq pFiles (vla-get-files (vla-get-preferences (vlax-get-acad-object))))  ;;get file preferences
     (setq tpPath (vla-get-toolPallettePath pFiles))  ;;get current tool pallette path
     (setq tpPath "C:\\ACAD\\ToolPallette\\up")  ;;set your path here
     (vla-put-toolPallettePath pFiles tpPath)  ;;set tool pallette path
    HTH,

  3. #3
    AUGI Addict kennet.sjoberg's Avatar
    Join Date
    2002-05
    Posts
    1,707
    Login to Give a bone
    0

    Default Re: tool palettes and lisp routine

    Quote Originally Posted by msretenovic
    ...(setq tpPath (vla-get-toolPallettePath pFiles)) ;;get current tool pallette path...
    Hi Michael, when I try
    (vl-load-com)
    (vla-get-toolPallettePath pFiles) I get
    Error: no function definition: VLA-GET-TOOLPALLETTEPATH
    why ? (AutoCAD 2002)

    : ) Happy Computing !

    kennet
    Last edited by kennet.sjoberg; 2005-04-26 at 06:16 AM.

  4. #4
    The Silent Type Mike.Perry's Avatar
    Join Date
    2000-11
    Posts
    13,656
    Login to Give a bone
    0

    Default Re: tool palettes and lisp routine

    Quote Originally Posted by kennet.sjoberg
    (vl-load-com)
    (vla-get-toolPallettePath pFiles) I get
    Error: no function definition: VLA-GET-TOOLPALLETTEPATH
    why ? (AutoCAD 2002)
    Hi

    Probably because Tool Palettes didn't exist in AutoCAD 2002, they first made their appearance in AutoCAD 2004.

    Have a good one, Mike

  5. #5
    100 Club Matt Mercer's Avatar
    Join Date
    2004-05
    Location
    Liberty Lake, WA
    Posts
    147
    Login to Give a bone
    0

    Default Re: tool palettes and lisp routine

    Thank you so much - this seemed to work great!!

    Matt

  6. #6
    I could stop if I wanted to msretenovic's Avatar
    Join Date
    2002-02
    Location
    Galloway, Oh
    Posts
    305
    Login to Give a bone
    0

    Wink Re: tool palettes and lisp routine

    Quote Originally Posted by MATT_MERCER_2000
    Thank you so much - this seemed to work great!!

    Matt
    Matt,

    No problem, that's what we're here for

  7. #7
    100 Club Matt Mercer's Avatar
    Join Date
    2004-05
    Location
    Liberty Lake, WA
    Posts
    147
    Login to Give a bone
    0

    Default Re: tool palettes and lisp routine

    I had more time to work on this I did find an error - if you see something I did wrong or stupid I sure appreciate any help.

    (setq pFiles (vla-get-files (vla-get-preferences (vlax-get-acad-object)))) ;;get file preferences
    (setq tpPath (vla-get-toolPallettePath pFiles)) ;;get current tool pallette path
    (setq tpPath "e:\\aec\\ACADwin 2005\\johnson\\ToolPalettes\\johnson mainfloor") ;;set your path here
    (vla-put-toolPallettePath pFiles tpPath) ;;set tool pallette path

    This is what I had in my "mp" lisp routine. I assumed that I set the path on line 3 to what I want. I'm using a server instead of my c drive. I get this error message.

    no function definition: VLA-GET-TOOLPALLETTEPATH

    I do have the support file looking in that same file.

    Thanks Matt
    Last edited by Matt Mercer; 2005-04-26 at 11:38 PM.

  8. #8
    The Silent Type Mike.Perry's Avatar
    Join Date
    2000-11
    Posts
    13,656
    Login to Give a bone
    0

    Default Re: tool palettes and lisp routine

    Quote Originally Posted by MATT_MERCER_2000
    I had more time to work on this I did find an error - if you see something I did wrong or stupid I sure appreciate any help.

    (setq pFiles (vla-get-files (vla-get-preferences (vlax-get-acad-object)))) ;;get file preferences
    (setq tpPath (vla-get-toolPallettePath pFiles)) ;;get current tool pallette path
    (setq tpPath "e:\\aec\\ACADwin 2005\\johnson\\ToolPalettes\\johnson mainfloor") ;;set your path here
    (vla-put-toolPallettePath pFiles tpPath) ;;set tool pallette path

    This is what I had in my "mp" lisp routine. I assumed that I set the path on line 3 to what I want. I'm using a server instead of my c drive. I get this error message.

    no function definition: VLA-GET-TOOLPALLETTEPATH
    Hi

    vla-get-toolPallettePath has one too many "l"'s

    Try the following....

    Code:
    (setq pFiles (vla-get-files (vla-get-preferences (vlax-get-acad-object))))  ;;get file preferences
     (setq tpPath (vla-get-toolPalettePath pFiles))  ;;get current tool palette path
     (setq tpPath "E:\\aec\\ACADwin 2005\\johnson\\ToolPalettes\\johnson mainfloor")  ;;set your path here
     (vla-put-toolPalettePath pFiles tpPath)  ;;set tool palette path
    Have a good one, Mike

  9. #9
    I could stop if I wanted to msretenovic's Avatar
    Join Date
    2002-02
    Location
    Galloway, Oh
    Posts
    305
    Login to Give a bone
    1

    Thumbs up Re: tool palettes and lisp routine

    Quote Originally Posted by MATT_MERCER_2000
    ...I get this error message.

    no function definition: VLA-GET-TOOLPALLETTEPATH...
    Quote Originally Posted by Mike.Perry
    vla-get-toolPallettePath has one too many "l"'s
    Sorry, that was my fault. As Mr. Perry has already pointed out, I have placed one too many "l"'s in the function name. Thanks Mike for pointing that out

  10. #10
    100 Club Matt Mercer's Avatar
    Join Date
    2004-05
    Location
    Liberty Lake, WA
    Posts
    147
    Login to Give a bone
    0

    Default Re: tool palettes and lisp routine

    I got it working great now. Thanks again everone for your help. I did add the ".atc" at the end of the search path and seems to work just like I want it to.

    Matt

Page 1 of 2 12 LastLast

Similar Threads

  1. CP223-1: Trick Up Your Tool Palettes: How to Make Your Tool Palettes Do Even More!
    By Autodesk University in forum Customization and Programming
    Replies: 0
    Last Post: 2015-08-07, 05:17 PM
  2. Is Lisp the right tool to create this routine?
    By Gary.182361 in forum AutoLISP
    Replies: 2
    Last Post: 2009-08-10, 07:03 AM
  3. Lisp code when inserting blocks from tool palettes
    By autocad.wishlist1734 in forum AutoCAD Wish List
    Replies: 1
    Last Post: 2006-06-02, 12:49 PM
  4. Run LISP routine on AutoCAD 2006 Tool Palettes
    By mwilson in forum AutoCAD Customization
    Replies: 9
    Last Post: 2006-01-27, 07:24 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
  •