Page 1 of 4 1234 LastLast
Results 1 to 10 of 35

Thread: Open drawing read-only via command line

  1. #1
    Active Member
    Join Date
    2004-02
    Posts
    60
    Login to Give a bone
    0

    Default Open drawing read-only via command line

    Does anyone know if I can open a drawing read only by the command line only? here is sudo-code to what I think should happen.

    filedia
    0
    Open
    filename.dwg <ReadOnly>

    Any help would be appreciated,
    Jason Self

  2. #2
    The Silent Type RobertB's Avatar
    Join Date
    2000-01
    Location
    Seattle WA USA
    Posts
    5,859
    Login to Give a bone
    0

    Default Re: Open drawing read-only via command line

    The easiest way to do it is to use the (open) statement in append mode, then open the drawing in the editor. That makes it readonly.

  3. #3
    Past Vice President / AUGI Volunteer peter's Avatar
    Join Date
    2000-09
    Location
    Honolulu HI
    Posts
    1,106
    Login to Give a bone
    0

    Default Re: Open drawing read-only via command line

    The VBASTMT command can do that

    Type this as the expression after running the vbastmt

    The true is the flag for read-only

    (vl-cmdf "vbastmt"
    "acadapplication.documents.open \"c:/acad/312vg.dwg\",TRUE")

    Peter Jamtgaard

  4. #4
    Active Member
    Join Date
    2004-02
    Posts
    60
    Login to Give a bone
    0

    Default Re: Open drawing read-only via command line

    Thanks for the tips, but upon further thinking I came to another question....

    This particular lisp is designed to write a script and then call the script to do batch plotting of our drawings. It kinda forces certain settings etc. etc. The problem is happening because on some installations (and mine has started doing it) it asks me if I want to open a drawing read only...this throws my script into complete chaos. The drawings that are being selected are not read-only they are not open by anyone else but for some reason autocad thinks it is when this script starts to run.....oddly enough, if I manually run the script that is generated it does not tell me that drawings are read only, in fact it works exactly as it should.

    I don't know if that tells anybody anything or not but if anyone has seen anything like this I would appreciate any tips.

    Thank you,
    Jason

  5. #5
    AUGI Addict kennet.sjoberg's Avatar
    Join Date
    2002-05
    Posts
    1,707
    Login to Give a bone
    0

    Default Re: Open drawing read-only via command line

    Be sure that You do not have anyone of the drawings in "Window drop down list" or the active one in the script You are trying to run.

    : ) Happy Computing !

    kennet

  6. #6
    Active Member
    Join Date
    2004-02
    Posts
    60
    Login to Give a bone
    0

    Default Re: Open drawing read-only via command line

    This is happening with no other drawings open, except for a fresh new drawing to run the lisp from. I have set the lisp up to actually check to see if the active drawing is new or not. The odd thing is that If with this script I select only one file it seems to run correctly. I am using DOSLib to select the files to be processed.

  7. #7
    AUGI Addict kennet.sjoberg's Avatar
    Join Date
    2002-05
    Posts
    1,707
    Login to Give a bone
    0

    Default Re: Open drawing read-only via command line

    Can You post a generated script file ? (no hands)
    with at least 3 drawing names to process.

    : ) Happy Computing !

    kennet

  8. #8
    Active Member
    Join Date
    2004-02
    Posts
    60
    Login to Give a bone
    0

    Default Re: Open drawing read-only via command line

    Code:
    open
    I:/Jobfi~QB/2004/04-0321/T-1.0.dwg
    osmode
    16
    filedia
    0
    -layout
    s
    24x36
    -plot
    yes
    24x36
    DesignJet 1050C.pc3
    Arch D - 24 x 36 In. (landscape)
    Inches
    Landscape
    No
    window
    (list 0.0 23.5)
    (list 36.0 0.0)
    1:1
    C
    yes
    Intertech Lineweight.ctb
    yes
    yes
    yes
    no
    yes
    
    no
    yes
    ._Close
    open
    I:/Jobfi~QB/2004/04-0321/A-1.0.dwg
    osmode
    16
    filedia
    0
    -layout
    s
    24x36
    -plot
    yes
    24x36
    DesignJet 1050C.pc3
    Arch D - 24 x 36 In. (landscape)
    Inches
    Landscape
    No
    window
    (list 0.0 23.5)
    (list 36.0 0.0)
    1:1
    C
    yes
    Intertech Lineweight.ctb
    yes
    yes
    yes
    no
    yes
    
    no
    yes
    ._Close
    open
    I:/Jobfi~QB/2004/04-0321/A-2.0.dwg
    osmode
    16
    filedia
    0
    -layout
    s
    24x36
    -plot
    yes
    24x36
    DesignJet 1050C.pc3
    Arch D - 24 x 36 In. (landscape)
    Inches
    Landscape
    No
    window
    (list 0.0 23.5)
    (list 36.0 0.0)
    1:1
    C
    yes
    Intertech Lineweight.ctb
    yes
    yes
    yes
    no
    yes
    
    no
    yes
    ._Close
    open
    I:/Jobfi~QB/2004/04-0321/A-3.0.dwg
    osmode
    16
    filedia
    0
    -layout
    s
    24x36
    -plot
    yes
    24x36
    DesignJet 1050C.pc3
    Arch D - 24 x 36 In. (landscape)
    Inches
    Landscape
    No
    window
    (list 0.0 23.5)
    (list 36.0 0.0)
    1:1
    C
    yes
    Intertech Lineweight.ctb
    yes
    yes
    yes
    no
    yes
    
    no
    yes
    ._Close
    open
    I:/Jobfi~QB/2004/04-0321/A-4.0.dwg
    osmode
    16
    filedia
    0
    -layout
    s
    24x36
    -plot
    yes
    24x36
    DesignJet 1050C.pc3
    Arch D - 24 x 36 In. (landscape)
    Inches
    Landscape
    No
    window
    (list 0.0 23.5)
    (list 36.0 0.0)
    1:1
    C
    yes
    Intertech Lineweight.ctb
    yes
    yes
    yes
    no
    yes
    
    no
    yes
    ._Close
    open
    I:/Jobfi~QB/2004/04-0321/A-5.0.dwg
    osmode
    16
    filedia
    0
    -layout
    s
    24x36
    -plot
    yes
    24x36
    DesignJet 1050C.pc3
    Arch D - 24 x 36 In. (landscape)
    Inches
    Landscape
    No
    window
    (list 0.0 23.5)
    (list 36.0 0.0)
    1:1
    C
    yes
    Intertech Lineweight.ctb
    yes
    yes
    yes
    no
    yes
    
    no
    yes
    ._Close
    open
    I:/Jobfi~QB/2004/04-0321/A-6.0.dwg
    osmode
    16
    filedia
    0
    -layout
    s
    24x36
    -plot
    yes
    24x36
    DesignJet 1050C.pc3
    Arch D - 24 x 36 In. (landscape)
    Inches
    Landscape
    No
    window
    (list 0.0 23.5)
    (list 36.0 0.0)
    1:1
    C
    yes
    Intertech Lineweight.ctb
    yes
    yes
    yes
    no
    yes
    
    no
    yes
    ._Close
    open
    I:/Jobfi~QB/2004/04-0321/A-7.0.dwg
    osmode
    16
    filedia
    0
    -layout
    s
    24x36
    -plot
    yes
    24x36
    DesignJet 1050C.pc3
    Arch D - 24 x 36 In. (landscape)
    Inches
    Landscape
    No
    window
    (list 0.0 23.5)
    (list 36.0 0.0)
    1:1
    C
    yes
    Intertech Lineweight.ctb
    yes
    yes
    yes
    no
    yes
    
    no
    yes
    ._Close
    open
    I:/Jobfi~QB/2004/04-0321/E-1.0.dwg
    osmode
    16
    filedia
    0
    -layout
    s
    24x36
    -plot
    yes
    24x36
    DesignJet 1050C.pc3
    Arch D - 24 x 36 In. (landscape)
    Inches
    Landscape
    No
    window
    (list 0.0 23.5)
    (list 36.0 0.0)
    1:1
    C
    yes
    Intertech Lineweight.ctb
    yes
    yes
    yes
    no
    yes
    
    no
    yes
    ._Close
    open
    I:/Jobfi~QB/2004/04-0321/E-2.0.dwg
    osmode
    16
    filedia
    0
    -layout
    s
    24x36
    -plot
    yes
    24x36
    DesignJet 1050C.pc3
    Arch D - 24 x 36 In. (landscape)
    Inches
    Landscape
    No
    window
    (list 0.0 23.5)
    (list 36.0 0.0)
    1:1
    C
    yes
    Intertech Lineweight.ctb
    yes
    yes
    yes
    no
    yes
    
    no
    yes
    ._Close
    open
    I:/Jobfi~QB/2004/04-0321/M-1.0.dwg
    osmode
    16
    filedia
    0
    -layout
    s
    24x36
    -plot
    yes
    24x36
    DesignJet 1050C.pc3
    Arch D - 24 x 36 In. (landscape)
    Inches
    Landscape
    No
    window
    (list 0.0 23.5)
    (list 36.0 0.0)
    1:1
    C
    yes
    Intertech Lineweight.ctb
    yes
    yes
    yes
    no
    yes
    
    no
    yes
    ._Close
    open
    I:/Jobfi~QB/2004/04-0321/M-1.1.dwg
    osmode
    16
    filedia
    0
    -layout
    s
    24x36
    -plot
    yes
    24x36
    DesignJet 1050C.pc3
    Arch D - 24 x 36 In. (landscape)
    Inches
    Landscape
    No
    window
    (list 0.0 23.5)
    (list 36.0 0.0)
    1:1
    C
    yes
    Intertech Lineweight.ctb
    yes
    yes
    yes
    no
    yes
    
    no
    yes
    ._Close
    open
    I:/Jobfi~QB/2004/04-0321/P-1.0.dwg
    osmode
    16
    filedia
    0
    -layout
    s
    24x36
    -plot
    yes
    24x36
    DesignJet 1050C.pc3
    Arch D - 24 x 36 In. (landscape)
    Inches
    Landscape
    No
    window
    (list 0.0 23.5)
    (list 36.0 0.0)
    1:1
    C
    yes
    Intertech Lineweight.ctb
    yes
    yes
    yes
    no
    yes
    
    no
    yes
    ._Close



    It generates slightly differently depending on autocad versions, this one is for 2005. It has some lines that may appear rhetorical but it has to do with things that load at each drawing open, running this via the command 'script' works perfectly, its calling it with the lisp that gives me problems. I would have to post alot of stuff to get the lisp working. but here is the important part.

    It calls this
    Code:
    (defun RUNSCRIPT ()
        (command "script" "c:/distribute.scr")
      )
    Last edited by JasonSelf; 2004-12-15 at 10:45 PM.

  9. #9
    AUGI Addict kennet.sjoberg's Avatar
    Join Date
    2002-05
    Posts
    1,707
    Login to Give a bone
    0

    Default Re: Open drawing read-only via command line

    _CLOSE N
    open

    or

    _CLOSE Y
    open

    N when save, Y when not save

    : ) Happy Computing !

    kennet

  10. #10
    Active Member
    Join Date
    2004-02
    Posts
    60
    Login to Give a bone
    0

    Default Re: Open drawing read-only via command line

    That is not where the problem is occuring, I think I know your exact thought with that statement. AutoCAD 2k4 and lower asks if you don't make any drawing changes and all you do is zoom or print, however AutoCAD 2k5 and greater does not, in the script generated if a 2k4 machine is the one running it, it has the Y and the N. The script does not get passed the first open command when it is being run from the lisp so it never reaches the first close command.

Page 1 of 4 1234 LastLast

Similar Threads

  1. Open Read-Only: The ability to open a worksharing enabled file in a read only mode.
    By revit.wishlist1942 in forum Revit Architecture - Wish List
    Replies: 5
    Last Post: 2012-09-05, 07:02 PM
  2. Open Drawing read-only from Explorer
    By rkmcswain in forum AutoCAD Tips & Tricks
    Replies: 17
    Last Post: 2011-03-29, 05:00 PM
  3. Variable to control Save if a drawing is open Read Only
    By autocad.wishlist1734 in forum AutoCAD Wish List
    Replies: 4
    Last Post: 2008-02-27, 07:18 PM
  4. Open XREF Drawing Read Only
    By autocad.wishlist1734 in forum AutoCAD Wish List
    Replies: 0
    Last Post: 2007-10-08, 03:50 PM
  5. Open read only turns into actual live drawing
    By Steve_Bennett in forum AutoCAD General
    Replies: 18
    Last Post: 2007-04-24, 08:34 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
  •