Results 1 to 6 of 6

Thread: Templates on Toolpalettes

  1. #1
    Member
    Join Date
    2008-06
    Posts
    30

    Default Templates on Toolpalettes

    Is there a way to create a new drawing from a template using the toolpalette.

    I have tried dragging the .dwt file into the toolpalette but had no luck with that!

    Any ideas?

    Many thanks!

  2. #2
    I could stop if I wanted to
    Join Date
    2003-12
    Location
    Pittsburgh, PA
    Posts
    355

    Default Re: Templates on Toolpalettes

    Use this as the command string on a toolpalette tool. A new dwg will be created using the Acad.dwt as the template. Edit as you want.
    Code:
    (vl-load-com)(vla-activate (vla-add (vla-get-documents (vlax-get-acad-object)) "acad.dwt"))
    Attached Images Attached Images

  3. #3
    Member
    Join Date
    2008-06
    Posts
    30

    Default Re: Templates on Toolpalettes

    Many thanks for the reply.

    The code works great. However, I need a similar code that works within LT.... I have tried all kinds of C^C^ macro combinations but I can not seem to work out the correct code for this little puzzle! There has to be a way surely lol

  4. #4
    Certifiable AUGI Addict irneb's Avatar
    Join Date
    2007-07
    Location
    Jo'burg SA
    Posts
    4,348

    Default Re: Templates on Toolpalettes

    That code's a lisp expression, LT don't do Lisp.

    Maybe you could use a script file. Basically a text file containing all the keystrokes you'd issue at the command line. E.g. the attached (rename to Test.SCR). Then your macro would be something like:
    Code:
    ^C^CSCRIPT;"C:/FullPath/Test.SCR";
    Unfortunately you can't use the new directly in a macro, since then the dialog opens - which is not possible to automate. You could go and set FILEDIA=0 before, but then you need to set it back, and if an error occurs you end up with users asking you why they can't open files anymore.

    Thus I'd go with Lisp as a 1st choice, Script if in LT.
    Attached Files Attached Files
    Knowledge is proportional to experience, but wisdom is inversely proportional to ego!
    My little bit of "wisdom": Hind-sight is useless, unless used to improve the next forethought!

  5. #5
    Member
    Join Date
    2008-06
    Posts
    30

    Default Re: Templates on Toolpalettes

    Spot on with the script !!

    Works a treat!

    Many thanks!

  6. #6
    100 Club
    Join Date
    2005-09
    Posts
    140

    Default Re: Templates on Toolpalettes

    Quote Originally Posted by lpseifert View Post
    Use this as the command string on a toolpalette tool. A new dwg will be created using the Acad.dwt as the template. Edit as you want.
    Code:
    (vl-load-com)(vla-activate (vla-add (vla-get-documents (vlax-get-acad-object)) "acad.dwt"))
    Hi, I know this is an old posting, but hopefully i'll still get a response from this... doing the same thing here.... trying to start a new drawing from a dwt by clicking a TP button, but using full version AutoCAD 2009.

    Done quite a bit of work with TPs.... but sorry to sound dumb.... how do I get a "toolpalette tool" onto the TP ? the image posted of the TP properties does not look like mine. Mine looks like this image but is for inserting a block

    ... so I got the macro working, now I just need some help getting the correct tool on the TP so I can activate it from there, thanks for the help
    Attached Images Attached Images
    Last edited by derek.96018; 2011-11-28 at 06:40 PM.

Similar Threads

  1. 2009: Toolpalettes and dwt
    By derek.96018 in forum AutoCAD Customization
    Replies: 26
    Last Post: 2012-04-02, 10:22 PM
  2. Power of ToolPalettes
    By J17 in forum AutoCAD Customization
    Replies: 5
    Last Post: 2008-11-19, 04:11 PM
  3. Problem with the toolpalettes
    By fathibaali in forum AMEP General
    Replies: 1
    Last Post: 2008-09-28, 08:00 PM
  4. Assigning ToolPalettes with Templates ?
    By stephen.coff in forum AutoCAD General
    Replies: 1
    Last Post: 2005-12-04, 10:22 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
  •