Auto file replace

Discussion in 'AutoCAD' started by Big 'D', Dec 13, 2004.

  1. Big 'D'

    Big 'D' Guest

    I have a set of drawings that have something mysterious that is causing me problems. I have spent enough time trying to figure out what the cause is. The easiest solution now is to copy all entities in a drawing, close it, open a new file, past all and saveas the original file name. I tried to run this using a script and icon on a toolbar (this way I can set up a non-cad user to fun these for me). The attached script runs fine until I get to the 'saveas' part. I at least want the dialog box to come up so all the user has to do is open the correct file, select the icon and click on the file name to save. Can anyone help with the script or even a lisp that would do this?

    Filedia
    0
    cmddia
    0
    _copyclip
    all

    _close
    no
    _new
    ..
    _pasteclip
    0,0
    zoom
    e
    Filedia
    1
    cmddia
    1
    saveas


    Thank you all for you help,
    D
     
    Big 'D', Dec 13, 2004
    #1
  2. Big 'D'

    mataeux Guest

    give us a shot at fixing the original problem
    post a sample drawing. what is the problem? when does the problem occur?




    problems. I have spent enough time trying to figure out what the cause is.
    The easiest solution now is to copy all entities in a drawing, close it,
    open a new file, past all and saveas the original file name. I tried to run
    this using a script and icon on a toolbar (this way I can set up a non-cad
    user to fun these for me). The attached script runs fine until I get to the
    'saveas' part. I at least want the dialog box to come up so all the user has
    to do is open the correct file, select the icon and click on the file name
    to save. Can anyone help with the script or even a lisp that would do this?
     
    mataeux, Dec 13, 2004
    #2
  3. Big 'D'

    Big 'D' Guest

    I would be glad to send you a file. Unfortunately, these are proprietary and I am not allowed to. I am converting the files to C4 raster. When I run the conversion file, a horizontal section of the drawing is repeated on the entire vertical portion of the C4 file. When I go through the process of creating a new drawing, copying all entities and saving (which is what I am trying to do with the script), the translation runs fine. I have over three hundred files I have to do this to. I am using ACAD 2002. None of these files are utilizing paper space/model space. They are all in model layout.

    Thanks for the feedback,
    D
     
    Big 'D', Dec 13, 2004
    #3
  4. Big 'D'

    Walt Engle Guest

    Proprietary means they are copyrighted and that is fine. Do you or anyone in your company really think users here are interested in theft of your company's work? With that mind-set, perhaps you should consider working out the problem from your end.
     
    Walt Engle, Dec 13, 2004
    #4
  5. Big 'D'

    OLD-CADaver Guest

    <<Do you or anyone in your company really think users here are interested in theft of your company's work? With that mind-set, perhaps you should consider working out the problem from your end. >>

    We have several clients with projects that include data for which patents have yet to be obtained, or use patented data which is still in negotiations. It would be a violation of contract to post those files to a public forum of any kind.

    Even without the contract, it would be unethical to post any information that one did not own.

    Were you and I the only two ever to troll these boards he may be safe in posting the files, but considering that this is a public forum, open to anyone, that assurance can not be maintained. I think chiding him for prudence is misplaced.
     
    OLD-CADaver, Dec 13, 2004
    #5
  6. Big 'D'

    Big 'D' Guest

    Mr. Engle,
    I appreciate you taking the time to review my dilemma You will notice on my original post that it is the attached script not working properly that is the issue, not the groups ethical behavior. These are government drawings entrusted to our care. If you have never worked for a government agency before you may not know that such an action could be deemed a federal offense and cause a company to lose all credibility and future work from any government establishment.
    That being said, how about that script not working? Any suggesstions?

    Respectfully,
    D
     
    Big 'D', Dec 13, 2004
    #6
  7. Big 'D'

    jlspartz Guest

    Why is the <br> there?

    Shouldn't the end of the script look like this?

    Filedia
    1
    cmddia
    1
    saveas

    Also, you may need to put a return after the saveas. If you wanted to do it with the filedia off and still get a window to pick the file you would exclude the filedia 1 part and then type:

    saveas
    2004 (or whatever version you want it saved as)
    ~ (the tilde will open the window for picking a file)
     
    jlspartz, Dec 13, 2004
    #7
  8. Big 'D'

    Big 'D' Guest

    I am thinking the <br> is just space I put between the saveas and my signature. I want the routine to stop with the dialog box open so I can select the original file name for my new drawing. I also want to end up with filedia and cmddia back on for the next file that I open (so I can repeat the process).

    Thank you for the assistance,
    D
     
    Big 'D', Dec 13, 2004
    #8
  9. Big 'D'

    jlspartz Guest

    Don't even bother turning the filedia back on until all your work is done, just do this:

    First do:
    Filedia
    0
    cmddia
    0
    _sdi
    1
    SDI sets it to single drawing mode and you don't need to close drawings - they close for you when you open a new one.

    Then do your script like this:
    _copyclip
    all


    _new
    n
    ..
    _pasteclip
    0,0
    zoom
    e
    saveas
    2004
    ~
    open
    ~
    It will open windows for you to pick the file, though filedia is still off.

    Last set your settings back:
    Filedia
    1
    cmddia
    1
    _sdi
    0

    You could automate the entire process by typing in the filenames into your script, but this is how you would do it with a user controlling it.
     
    jlspartz, Dec 13, 2004
    #9
  10. Big 'D'

    Rick Keller Guest

    Hi,

    I dont have any better answers than these guys have already given but.

    When you copyclip something it doesnt select 0,0 as the default insertion
    point.
    So pasting it in at 0,0 might move the objects around.
    Thats alright if you dont mind where they are at.
    Try:

    _copybase
    0,0
    all

    Rick
     
    Rick Keller, Dec 14, 2004
    #10
  11. Big 'D'

    Big 'D' Guest

    Rick,
    Placing at 0,0 is a good thing in this case. The lower most left corner of my objects should be at 0,0 so this will insure correct location. But thank you for the helpful tip. I will log it and use it sometime.

    D
     
    Big 'D', Dec 14, 2004
    #11
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.