See the top rated post in this thread. Click here

Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 27

Thread: Toolpalettes and dwt

  1. #11
    100 Club
    Join Date
    2005-09
    Posts
    184
    Login to Give a bone
    0

    Default Re: Toolpalettes and dwt

    Thanks RenderMan for the direction, unfortunately I need a little more hand holding to get this to work...

    I made a .txt file into and named it in your honor.... HTH.lsp because I do not know what it is and I needed something to start with.....

    Then I copied your code from above into it. Saved in on my C-Drive (for now); then went to appload and loaded the HTH.lsp.... HTH.lsp on the command line, nothing.

    What did I need to do that I did not pick up on to do. I know somewhere along the line, I will need to specify the name of the .dwt.

    Thanks in advance

  2. #12
    Administrator BlackBox's Avatar
    Join Date
    2009-11
    Posts
    5,714
    Login to Give a bone
    0

    Default Re: Toolpalettes and dwt

    First, you're welcome, and I am sorry for not being more clear in my earlier post(s). I was busy with my workload in advance of the Thanksgiving holiday, and traveling an hour each way to another office... I kind of rushed my replies.

    Second, there's no need to name anything in my honor; HTH stands for "Hope This Helps." LoL the gesture is very kind though.

    You did good copying the code I posted to a text file, and saved it with a .LSP file extension. For simplicity, let's name he file as "_NewDWGFromDWT.lsp" and let's save it in a location that resides within the Support File Search Paths (SFSP). If you're not sure which paths are included, use the Options command, and expand SFSP node on the Files tab.

    Next you need to write your Macro. Open the CUI Editor, and create a new command (bottom left pane). I typically incorporate an IF statement to demand load a routine the first time the command is invoked, so as to not load the routine into memory until needed.

    Example (written from memory, on my iPhone):

    Code:
    ^C^C^P(if (not _NewDWGFromDWT)(load "_NewDWGFromDWT.lsp"));(_NewDWGFromDWT "FileName.dwt");
    Now just customize your workspace as needed, i.e., Menu, Toolbar, and/or Ribbon functionality.

    When I get back in the office I can provide you some more info if needed. This should be enough to get you started.
    Last edited by RenderMan; 2011-11-28 at 07:37 PM.
    "How we think determines what we do, and what we do determines what we get."

    Sincpac C3D ~ Autodesk Exchange Apps

    Computer Specs:
    Dell Precision 3660, Core i9-12900K 5.2GHz, 64GB DDR5 RAM, PCIe 4.0 M.2 SSD (RAID 0), 16GB NVIDIA RTX A4000

  3. #13
    100 Club
    Join Date
    2005-09
    Posts
    184
    Login to Give a bone
    0

    Default Re: Toolpalettes and dwt

    Ok, thanks RenderMan !, so I created the Ribbon Tab, Panel and Button.... the button is for 7000.dwt we have 7001.dwt, 7002.dwt...... etc for furthering this project into more buttons, but I need to get 1 working to start.....
    I am getting this:
    (_>
    (_> *Cancel*
    ; error: Function cancelled

    This is the macro for the button:
    ^C^C^P(if (not _NewDWGFromDWT)(load "_NewDWGFromDWT.lsp");(_NewDWGFromDWT "7000.dwt");

    The .lisp file is located:
    C:\Program Files\AutoCAD 2009\Support
    (Would like to relocate it later to our T-Drive (tools drive where i have a Lisp folder) (1 thing at a time)

    The .lisp file name:
    _NewDWGFromDWT.lsp

    The Code for the lisp:
    (I copied it from your post with the code in it from above)

    The .dwt is located:
    U:\ACAD\TEMPLATE\Template Drawings\Sheet Pile
    (I did try copying the 7000.dwt directly into the folder that Acad has in the template file path (in options) which is this: U:\ACAD\TEMPLATE\SD Templates)

    I must be missing the bigger picture. I did change the part of the macro for the button to say '7000.dwt' instead of 'filename.dwt'... should it have stayed 'filename.dwt'.... think i got all of the info on here ! thanks for your help

  4. #14
    Certified AUGI Addict jaberwok's Avatar
    Join Date
    2000-12
    Location
    0,0,0 The Origin
    Posts
    8,570
    Login to Give a bone
    0

    Default Re: Toolpalettes and dwt

    The obvious next step is to insert the path to the dwt file -
    Code:
    ^C^C^P(if (not _NewDWGFromDWT)(load "_NewDWGFromDWT.lsp");(_NewDWGFromDWT "U:\ACAD\TEMPLATE\Template Drawings\Sheet Pile\7000.dwt");
    or add the path to your support path (Options\Files\Support ...) -
    Code:
    U:\ACAD\TEMPLATE\Template Drawings\Sheet Pile

  5. #15
    Administrator BlackBox's Avatar
    Join Date
    2009-11
    Posts
    5,714
    Login to Give a bone
    0

    Default Re: Toolpalettes and dwt

    Quote Originally Posted by jaberwok View Post
    The obvious next step is to insert the path to the dwt file -
    Code:
    ^C^C^P(if (not _NewDWGFromDWT)(load "_NewDWGFromDWT.lsp");(_NewDWGFromDWT "U:\ACAD\TEMPLATE\Template Drawings\Sheet Pile\7000.dwt");
    or add the path to your support path (Options\Files\Support ...) -
    Code:
    U:\ACAD\TEMPLATE\Template Drawings\Sheet Pile
    Jaberwok is correct; if the template locations are not included within the SFSP, then you need to include the file path within the Macro.

    Also be aware that LISP requires double back-slashes "\\", or a single forward-slash "/" for file paths.

    Quote Originally Posted by derek.96018 View Post
    The .lisp file is located:
    C:\Program Files\AutoCAD 2009\Support
    (Would like to relocate it later to our T-Drive (tools drive where i have a Lisp folder) (1 thing at a time)

    The .lisp file name:
    _NewDWGFromDWT.lsp
    That said, the same holds true for _NewDWGFromDWT.lsp, if this file is not located within SFSP then you must also include the file path in the Macro.
    "How we think determines what we do, and what we do determines what we get."

    Sincpac C3D ~ Autodesk Exchange Apps

    Computer Specs:
    Dell Precision 3660, Core i9-12900K 5.2GHz, 64GB DDR5 RAM, PCIe 4.0 M.2 SSD (RAID 0), 16GB NVIDIA RTX A4000

  6. #16
    100 Club
    Join Date
    2005-09
    Posts
    184
    Login to Give a bone
    0

    Default Re: Toolpalettes and dwt

    Ok, thanks you guys... I really appreciate the time you are taking to help me out.....

    I am still getting the same result.

    I changed the macro to read:
    ^C^C^P(if (not _NewDWGFromDWT)(load "_NewDWGFromDWT.lsp");(_NewDWGFromDWT "U:\ACAD\TEMPLATE\Template Drawings\Sheet Pile\7000.dwt");

    I also tried adding the 7000.dwt to the folder that is in the SFSP... same thing.

    Am I doing what I need to do with the lisp ? It resides in the support folder on my C-drive, and have loaded it through appload... am I suppose to be altering it ?

  7. #17
    100 Club
    Join Date
    2005-09
    Posts
    184
    Login to Give a bone
    0

    Default Re: Toolpalettes and dwt

    Quote Originally Posted by RenderMan View Post
    Also be aware that LISP requires double back-slashes "\\", or a single forward-slash "/" for file paths.

    That said, the same holds true for _NewDWGFromDWT.lsp, if this file is not located within SFSP then you must also include the file path in the Macro.
    I did try this with the macro as well:
    ^C^C^P(if (not _NewDWGFromDWT)(load "_NewDWGFromDWT.lsp");(_NewDWGFromDWT "U:/ACAD/TEMPLATE/Template Drawings/Sheet Pile/7000.dwt");

    but I did not know what you meant about the lisp as I had not altered it from the original code

  8. #18
    Administrator BlackBox's Avatar
    Join Date
    2009-11
    Posts
    5,714
    Login to Give a bone
    0

    Default Re: Toolpalettes and dwt

    The above Macro uses LISP (the stuff inside the parenthesis).

    You're including the File Path for the .DWT as it (the template) does NOT reside within the SFSP. The same must be done for the .LSP (either place it in a location that is included in SFSP, or add the File Path).
    "How we think determines what we do, and what we do determines what we get."

    Sincpac C3D ~ Autodesk Exchange Apps

    Computer Specs:
    Dell Precision 3660, Core i9-12900K 5.2GHz, 64GB DDR5 RAM, PCIe 4.0 M.2 SSD (RAID 0), 16GB NVIDIA RTX A4000

  9. #19
    Administrator BlackBox's Avatar
    Join Date
    2009-11
    Posts
    5,714
    Login to Give a bone
    0

    Default Re: Toolpalettes and dwt

    Also... Note the missing close-parenthesis:

    ^C^C^P(if (not _NewDWGFromDWT) (load "_NewDWGFromDWT.lsp"));(_NewDWGFromDWT "U:/ACAD/TEMPLATE/Template Drawings/Sheet Pile/7000.dwt");
    "How we think determines what we do, and what we do determines what we get."

    Sincpac C3D ~ Autodesk Exchange Apps

    Computer Specs:
    Dell Precision 3660, Core i9-12900K 5.2GHz, 64GB DDR5 RAM, PCIe 4.0 M.2 SSD (RAID 0), 16GB NVIDIA RTX A4000

  10. #20
    100 Club
    Join Date
    2005-09
    Posts
    184
    Login to Give a bone
    0

    Default Re: Toolpalettes and dwt

    Hi, I just wanted to touch bases and update you on my progress (and to summarize, for others, the setup):

    Currently I am working with my new Ribbon MENU Tab and flyout button that launch drawing templates for me. I was having a problem getting things to work in the 'temporary state' (temporary locations of support files) so I put all of the support files where they were going to reside and gave it a 'go'.

    The Lisp:
    Location: T:\Lisp
    Lisp Name: _NewDWGFromDWT.lsp
    The Actual Lisp text:
    (defun _NewDWGFromDWT (dwt)
    (vl-load-com)
    (if (findfile dwt)
    (vla-activate
    (vla-add (vla-get-documents (vlax-get-acad-object))
    dwt))
    (prompt "\n** Template cannot be found ** ")))

    The Button Macro:
    ^C^C^P(if (not _NewDWGFromDWT)(load "T:/Lisp/_NewDWGFromDWT.lsp"));(_NewDWGFromDWT "U:/ACAD/TEMPLATE/Template Drawings/Sheet Pile/7000.dwt");

    The Template Drawing:
    Name: 7000.dwt
    Location: U:\ACAD\TEMPLATE\Template Drawings\Sheet Pile

    I am having some issues with the way the ribbon is displaying the flyouts (vertically/horizontally even though the settings appear to be the same) and other data (names and descriptions) as there are multiple places to put info that does not show up on that actual ribbon. But I have had to redirect my energy to billable work and have not been able to revisit those issues yet.

    Oh, and my Ctrl+Shift+S seems to be busted after I switch to the Templates tab !!

    Thank you jaberwok and RenderMan both for your input, direction and help.

Page 2 of 3 FirstFirst 123 LastLast

Similar Threads

  1. Templates on Toolpalettes
    By CAD-1311 in forum AutoCAD General
    Replies: 5
    Last Post: 2011-11-23, 12:24 AM
  2. Toolpalettes in CUI
    By autocad.wishlist1734 in forum AutoCAD Wish List
    Replies: 0
    Last Post: 2009-07-05, 05:58 PM
  3. Power of ToolPalettes
    By J17 in forum AutoCAD Customization
    Replies: 5
    Last Post: 2008-11-19, 05:11 PM
  4. Not Working ToolPalettes
    By sandeep_koodal in forum AutoCAD LT - General
    Replies: 0
    Last Post: 2007-10-30, 11:25 AM
  5. Using Blocks with ToolPalettes
    By stephen.coff in forum AutoCAD General
    Replies: 6
    Last Post: 2005-11-30, 02: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
  •