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

Thread: custom export or publish lisp routine

  1. #1
    100 Club timothyjturner's Avatar
    Join Date
    2005-09
    Location
    Columbus, OH
    Posts
    101
    Login to Give a bone
    0

    Default custom export or publish lisp routine

    Hello,

    After every drawing that I create I must go through the same steps and this has come to be time consuming.
    Is it possible to create a lisp that will do the following in this order?...

    1. Save as in a location that is input directy from a prompt given to the command line. If not possible then open the standard save as dialog box? Other ideas?
    2. Save as in a location that will not change.
    3. Plot with standard plot settings.

    The thing I need help with is step 1. I have no idea if any of this is possible. If I can understand how to accomplish step 1, then step 2 should be easy. I already have a lisp to do step 3.

    Thanks much!


    Tim Turner
    CAD Tech - Electrical
    Last edited by timothyjturner; 2005-10-27 at 03:15 PM.

  2. #2
    Administrator Opie's Avatar
    Join Date
    2002-01
    Location
    jUSt Here (a lot)
    Posts
    9,106
    Login to Give a bone
    0

    Default Re: custom export or publish lisp routine

    Timothy,

    You might look into this thread - LISP - Automatic Save that runs at set intervals. I think it will help you understand how to do steps one and/or step 2.
    If you have a technical question, please find the appropriate forum and ask it there.
    You will get a quicker response from your fellow AUGI members than if you sent it to me via a PM or email.
    jUSt

  3. #3
    100 Club timothyjturner's Avatar
    Join Date
    2005-09
    Location
    Columbus, OH
    Posts
    101
    Login to Give a bone
    0

    Default Re: custom export or publish lisp routine

    I have been looking through some of the code on these posts and there does seem to be some commands in there that I can use. I am using AutoCAD 2005 and I am looking through the Developer Documentation (accessed through the main help menu) and I am having trouble spottling a lot of these commands with the vl- prefix that seem very useful. Am I just overlooking the help on these commands or is there a better external reference?

    Thanks,

    Tim

  4. #4
    Administrator Opie's Avatar
    Join Date
    2002-01
    Location
    jUSt Here (a lot)
    Posts
    9,106
    Login to Give a bone
    0

    Default Re: custom export or publish lisp routine

    Within the developer help file you should have a link to the Autolisp Reference. You can browse through that for several of the Visual Lisp functions.

    You can also search the index of the developer help system for specific functions.
    If you have a technical question, please find the appropriate forum and ask it there.
    You will get a quicker response from your fellow AUGI members than if you sent it to me via a PM or email.
    jUSt

  5. #5
    I could stop if I wanted to tyshofner's Avatar
    Join Date
    2004-03
    Location
    Dallas, Tx
    Posts
    229
    Login to Give a bone
    0

    Default Re: custom export or publish lisp routine

    I wrote #2 in another thread a couple of days ago, modified it for #1. You could combine these into one routine though and include the plot.


    Code:
     
    ;#1
    (defun C:SAVELOC ( / sav_path dwg_name)
    (setvar "filedia" 0)
    (setq sav_path (getstring "Specify save path: "));Set the path you want here
    (setq dwg_name (getvar "dwgname"))
    (command "saveas" "" (strcat sav_path "\\" dwg_name))
    (setvar "filedia" 1)
    (princ)
    )
    ;#2
    (defun C:SAVELOC ( / sav_path dwg_name)
    (setvar "filedia" 0)
    (setq sav_path "C:\\Documents and Settings\\tys\\Desktop");Set the path you want here
    (setq dwg_name (getvar "dwgname"))
    (command "saveas" "" (strcat sav_path "\\" dwg_name))
    (setvar "filedia" 1)
    (princ)
    )
    Quick and dirty, no error checking .

    Ty

  6. #6
    100 Club timothyjturner's Avatar
    Join Date
    2005-09
    Location
    Columbus, OH
    Posts
    101
    Login to Give a bone
    0

    Thumbs up Re: custom export or publish lisp routine

    Doh!

    Thanks tyshofner, that was a lot easier than I expected. I should be able to use your example to do exactly what I want to do. But wow that was too easy, so I think I'm going to throw in another challenge. This program would be even more convenient if you could extract the drawing name from the actual drawing.

    I don't know enough about attributes... but is it possible to get a string value from an already defined attribute so I can name my file? All I know is that when I doubleclick text in these standardized drawings, an edit attributes dialog box comes up and gives you an opportunity to enter a new value. Are these values stored anywhere? How can I get them into my program?

  7. #7
    I could stop if I wanted to tyshofner's Avatar
    Join Date
    2004-03
    Location
    Dallas, Tx
    Posts
    229
    Login to Give a bone
    0

    Default Re: custom export or publish lisp routine

    #1
    What do you meen when you say "Extract the drawing name from the actual drawing.". This routine does get the drawing name of the drawing your in and appends it to the path you specify. Are you wanting something else??

    #2
    Yes you can get the string value of an attribute, but you'll need to know a few things.
    1. What is the attribute "tag"? (look in the attribute editor, or explode the block)
    2. What is the name of the block the attribute is contained within? (properties)
    3. Is there only ONE instance of the block in the drawing or are there multiple?

    Let me know and this should get us started.

    Ty

  8. #8
    100 Club timothyjturner's Avatar
    Join Date
    2005-09
    Location
    Columbus, OH
    Posts
    101
    Login to Give a bone
    0

    Default Re: custom export or publish lisp routine

    Block: TITLE3
    Tag: DWGNUM


    The drawing name is already stored in this tag...i just need to get this into my autolisp routine as a string. That's all I want. Sorry for sounding so complicated.

  9. #9
    Administrator Opie's Avatar
    Join Date
    2002-01
    Location
    jUSt Here (a lot)
    Posts
    9,106
    Login to Give a bone
    0

    Default Re: custom export or publish lisp routine

    Timothy,

    The drawing name (as shown in AutoCAD) can be extracted from the dwgname system variable. This variable is not dependent of any attribute.
    If you have a technical question, please find the appropriate forum and ask it there.
    You will get a quicker response from your fellow AUGI members than if you sent it to me via a PM or email.
    jUSt

  10. #10
    100 Club timothyjturner's Avatar
    Join Date
    2005-09
    Location
    Columbus, OH
    Posts
    101
    Login to Give a bone
    0

    Default Re: custom export or publish lisp routine

    Richard,

    You answered my question correctly but I asked the wrong question. The drawings I work on contain the drawing number as a text attribute. I want to use the drawing number tag to rename my file through autolisp.

    Thanks,

    Tim

Page 1 of 2 12 LastLast

Similar Threads

  1. Custom LISP Routine please!
    By Crask422 in forum AutoLISP
    Replies: 1
    Last Post: 2015-02-08, 06:24 PM
  2. Help with a lisp routine to add a 12" line to this routine
    By Orbytal.edge341183 in forum AutoLISP
    Replies: 3
    Last Post: 2012-11-14, 10:33 PM
  3. Combine three lisp routine into one routine.
    By BrianTFC in forum AutoLISP
    Replies: 1
    Last Post: 2012-02-08, 12:14 PM
  4. Replies: 9
    Last Post: 2012-01-21, 07:58 AM
  5. how to get dvb to run before publish plot routine
    By Hammer.John.J in forum VBA/COM Interop
    Replies: 1
    Last Post: 2006-08-10, 12:17 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
  •