Results 1 to 7 of 7

Thread: How can I change LDD drawing scale using lisp?

  1. #1
    Tomdum Guest

    How can I change LDD drawing scale using lisp?

    How can I change LDD drawing scale using lisp? Changing "ltscale" and "dimscale" isn't working. It seems like after I call a LDD function the scale goes back to what it was in Project>Drawing Setup...
    Anyone?
    Thanks,
    Tom

  2. #2
    Walt Engle Guest
    Been a very long time since I programmed lisp, but:

    (command "setvar" "dimscale" "x")
    (command "setvar" "ltscale" "y")

    I use the following in my acad.lsp:
    (COMMAND "SETVAR" "LTSCALE" (/ (GETVAR "DIMSCALE") 2))

    to make certain my ltscale is 1/2 the dimscale of new or older dwgs.

  3. #3
    R.K. McSwain Guest
    Tomdum wrote:

    How can I change LDD drawing scale using lisp? Changing "ltscale"
    and "dimscale" isn't working. It seems like after I call a LDD
    function the scale goes back to what it was in Project>Drawing
    Setup... Anyone? Thanks, Tom
    Why do you want it different than what you specify in "Drawing Setup"?

    ------------

    If you are just looking for a way to programatically control those
    settings, you need to look into the LDT API.

    Open \Program Files\Land Desktop 2005\Help\landauto-reference.chm

    Check out the Object Model, specifically the DatabasePreferences object.

  4. #4
    Tomdum Guest
    It's a routine that reacts to PLOT. We use psltscale set to 1 and ltscale set to 1 when we have mutiple viewports with mutiple scales. That way our line types come out right.

  5. #5
    Josh Guest
    I wrote this to solve the problem you are having...it saves me from having
    to start LDD just to change the DIMSCALE and make it stick. It sets LDD's
    scale as well as the current DIMSCALE.

    ;;;grabs the AEC dict that contains the LDD scale and sets it to current
    DIMSCALE
    (defun c:dimscale (/ a b dimscale)

    (defun dxf (code elist) (cdr (assoc code elist)))

    (setq a (dictsearch (namedobjdict) "AEC_VARS"))
    (if a
    (progn
    (setq b (dictnext (dxf -1 a) t))
    (while (not (= (dxf 0 b) "AEC_VARS_DWG_SETUP"))
    (setq b (dictnext (dxf -1 a)))
    )
    (setq
    dimscale (getreal (strcat "\nEnter new value for DIMSCALE <"
    (rtos (dxf 40 b))
    ">: "
    )
    )
    )
    (if (not dimscale)
    (setq dimscale (dxf 40 b))
    )
    (setq b (entmod (subst (cons 40 dimscale) (assoc 40 b) b)))
    )
    (progn
    (setq
    dimscale (getreal (strcat "\nEnter new value for DIMSCALE <"
    (rtos (getvar "dimscale"))
    ">: "
    )
    )
    )
    (if (not dimscale)
    (setq dimscale (getvar "dimscale"))
    )
    )
    )
    (setvar "dimscale" dimscale)
    (princ)
    )



    "Tomdum" <nospam@address.withheld> wrote in message
    news:17859474.1103671618600.JavaMail.jive@jiveforu m1.autodesk.com...
    How can I change LDD drawing scale using lisp? Changing "ltscale" and
    "dimscale" isn't working. It seems like after I call a LDD function the
    scale goes back to what it was in Project>Drawing Setup...
    Anyone?
    Thanks,
    Tom

  6. #6
    John Uhden Guest
    You should use the DatabaseScale property of the DatabasePreferences object of
    the ActiveDocument object of the ActiveProject object of the current
    AeccApplication.

    You probably need to study the landauto-reference.chm help file.

    Now I could give you a copy of my dictionary method that Josh suggested, but
    you'd be better off learning ActiveX methods.

    --
    John Uhden, Cadlantic
    <the e-mail address is bogus>
    http://www.cadlantic.com
    Sea Girt, NJ


    "Tomdum" <nospam@address.withheld> wrote in message
    news:17859474.1103671618600.JavaMail.jive@jiveforu m1.autodesk.com...
    How can I change LDD drawing scale using lisp? Changing "ltscale" and
    "dimscale" isn't working. It seems like after I call a LDD function the scale
    goes back to what it was in Project>Drawing Setup...
    Anyone?
    Thanks,
    Tom

  7. #7
    Tomdum Guest
    Thanks, That's what I was looking for.
    Tom

Similar Threads

  1. Replies: 2
    Last Post: 03-17-2005, 09:43 PM
  2. Change active drawing with visual lisp in Autocad 2005?
    By Ted Kyte in forum Customization
    Replies: 2
    Last Post: 03-14-2005, 08:09 AM
  3. Change Default Scale In Sketcher 2001i
    By Edge in forum Pro/Engineer
    Replies: 1
    Last Post: 03-04-2005, 10:40 AM
  4. Scale without change the dimension text.
    By Kerrie in forum AutoCAD
    Replies: 3
    Last Post: 02-11-2005, 02:00 AM
  5. Replies: 2
    Last Post: 11-19-2004, 09:53 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
  •  
Other forums: Access Forum - Microsoft Office Forum - Exchange Server Forum