See the top rated post in this thread. Click here

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

Thread: copy dwg name to clipboard

  1. #1
    Member
    Join Date
    2007-09
    Posts
    10
    Login to Give a bone
    0

    Default copy dwg name to clipboard

    Hi

    How can I copy a dwg name to clipboard from cad?

    I am trying to write a script so that I can use CutePDF Writer to batch plot Pdf's. I am having trouble extracting the drawing name (preferably without the .dwg extension) and then pasting it into the CutePDF Save As dialouge box.

    Any help will be most apriciated.

    Many thanks

    Grayham

    Edit: This is the script I have so far.

    (getvar "dwgname")
    -plot
    no


    CutePDF Writer
    no
    no
    yes
    (princ)

  2. #2
    Administrator rkmcswain's Avatar
    Join Date
    2004-09
    Location
    Earth
    Posts
    9,823
    Login to Give a bone
    0

    Default Re: copy dwg name to clipboard

    67172
    Quote Originally Posted by grayham.roper.146880 View Post
    How can I copy a dwg name to clipboard from cad?
    The easiest way would be to use DOSLIB.
    The call would be (dos_clipboard (getvar "dwgname"))

    If you do not want to rely on 3rd party ARX files though, then there may be other ways.
    R.K. McSwain | CAD Panacea |

  3. #3
    All AUGI, all the time arshiel88's Avatar
    Join Date
    2005-02
    Location
    Off the Grid
    Posts
    560
    Login to Give a bone
    0

    Default Re: copy dwg name to clipboard

    Alternatively in VBA...

    Code:
    Sub CopyDrawingName()
    
    Dim ClipData As New DataObject
    Dim strLength As Integer
    Dim sysVarName As String
    
    sysVarName = "DWGNAME"
    varData = ThisDrawing.GetVariable(sysVarName)
    strLength = Len(varData) - 4
    TextVar = Left(varData, strLength)
    ClipData.SetText (TextVar)
    ClipData.PutInClipboard
    
    End Sub
    Just paste this code in a module then you can insert -vbarun CopyDrawingName in your script. I haven't tried the script part. Hope it works. Good Luck and Welcome to AUGI.

  4. #4
    Member
    Join Date
    2007-09
    Posts
    10
    Login to Give a bone
    0

    Default Re: copy dwg name to clipboard

    Thanks for the advice I have managed to copy the drawing name to clipboard.

    What I now need to do is paste it to a Save As dialog box that opens, if possible if this is possible.

    Many thanks

    Grayham.

  5. #5
    All AUGI, all the time Avatart's Avatar
    Join Date
    2004-06
    Location
    Upsidedown in dreamtown
    Posts
    928
    Login to Give a bone
    1

    Default Re: copy dwg name to clipboard

    I would get the filename sans extension using:
    Code:
     
    (vl-filename-base (getvar "DWGNAME"))
    To paste it into another app could prove a little tricky, from you code I am assuming you are using the Command Line printing routine?

    If so then I think you could set a Lisp variable and then use that variable further down you script, like this:
    Code:
     
    (setvar "TEXTEVAL" 1)
    (setvar "FILEDIA" 0)
    (setq dwgname (vl-filename-base (getvar "DWGNAME")))
    ~your plot routine up to asking for name~
    !dwgname
    ~rest of plot routine, if any~
    (setvar "FILEDIA" 1)
    (setq dwgname nil)

  6. #6
    Administrator rkmcswain's Avatar
    Join Date
    2004-09
    Location
    Earth
    Posts
    9,823
    Login to Give a bone
    0

    Default Re: copy dwg name to clipboard

    Quote Originally Posted by grayham.roper.146880 View Post
    I am trying to write a script so that I can use CutePDF Writer to batch plot Pdf's.
    You are going to find the freebie "CutePDF" difficult, if not impossible to deal with as far as file names, not to mention other aspects. If you need to print a lot of PDF's, consider getting a seat of AcroPlot.
    R.K. McSwain | CAD Panacea |

  7. #7
    All AUGI, all the time Avatart's Avatar
    Join Date
    2004-06
    Location
    Upsidedown in dreamtown
    Posts
    928
    Login to Give a bone
    0

    Default Re: copy dwg name to clipboard

    Quote Originally Posted by rkmcswain View Post
    You are going to find the freebie "CutePDF" difficult, if not impossible to deal with as far as file names, not to mention other aspects. If you need to print a lot of PDF's, consider getting a seat of AcroPlot.
    We use CutePDF as a printer profile in our default drawing template, no problems at all.

    The other way to deal with it would be to use a Batch Plotter. I'm sure you could get a freebie off the 'net. My company does do one you can buy, but hey, why pay if you don't have to?

  8. #8
    Administrator rkmcswain's Avatar
    Join Date
    2004-09
    Location
    Earth
    Posts
    9,823
    Login to Give a bone
    0

    Default Re: copy dwg name to clipboard

    Quote Originally Posted by carl_hd_collins View Post
    We use CutePDF
    We tried it for a while, but there were too many problems. AcroPlot cost a bit of course, but since installing - we have not looked back.
    R.K. McSwain | CAD Panacea |

  9. #9
    All AUGI, all the time Avatart's Avatar
    Join Date
    2004-06
    Location
    Upsidedown in dreamtown
    Posts
    928
    Login to Give a bone
    0

    Default Re: copy dwg name to clipboard

    Quote Originally Posted by rkmcswain View Post
    We tried it for a while, but there were too many problems. AcroPlot cost a bit of course, but since installing - we have not looked back.
    We embedded the CutePDF in our Batch Plot routine, works fine for us. I think that once you get the setup right, it's OK, just takes a bit of setting up.

  10. #10
    Administrator rkmcswain's Avatar
    Join Date
    2004-09
    Location
    Earth
    Posts
    9,823
    Login to Give a bone
    0

    Default Re: copy dwg name to clipboard

    Quote Originally Posted by carl_hd_collins View Post
    We embedded the CutePDF in our Batch Plot routine, works fine for us. I think that once you get the setup right, it's OK, just takes a bit of setting up.

    How do you configure the output file name?
    What do you do about "lines merge"?
    What if you want separate PDF files for each layout?
    What if you want a single PDF from all layouts?
    What about bookmarks in the PDF?
    R.K. McSwain | CAD Panacea |

Page 1 of 2 12 LastLast

Similar Threads

  1. Copy to Clipboard failed
    By saimyat in forum AutoCAD General
    Replies: 4
    Last Post: 2010-09-27, 07:34 PM
  2. copy to clipboard
    By johnf.77896 in forum Revit Architecture - General
    Replies: 3
    Last Post: 2009-07-31, 02:51 PM
  3. Copy to Clipboard Issue
    By dgreen.49364 in forum Revit Architecture - General
    Replies: 2
    Last Post: 2009-06-12, 03:10 PM
  4. Can't Copy to clipboard
    By johnbillman in forum AutoCAD General
    Replies: 5
    Last Post: 2008-03-30, 10:44 PM
  5. Copy to Clipboard
    By d.stairmand in forum Revit Architecture - General
    Replies: 1
    Last Post: 2008-02-13, 12:33 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •