Results 1 to 6 of 6

Thread: 2016 AutoCAD basic Lisp help requested

  1. #1
    Login to Give a bone
    0

    Default 2016 AutoCAD basic Lisp help requested

    I think I have the worlds most basic lsp to set dimension styles and just can't get it to run when called from another routine.
    My code;
    Code:
    (defun c:10mm ()
    	(setvar "DIMSCALE" 10)
    	(COMMAND "-DIMSTYLE" "SAVE" "10mm" "y")   
    )
    I want it to override the current version of 10mm dimstyle so I need the "y".
    The problem arises at the "y" bit, as below;
    Command: 10mm
    Current dimension style: STANDARD Annotative: No
    Unable to recognize command "y". Please try again."y"

    However if I just paste the line containing the "y" as below at the command line, it works fine.
    (COMMAND "-DIMSTYLE" "SAVE" "10mm" "y")

    Any suggestions??
    Last edited by Opie; 2020-08-04 at 04:16 PM. Reason: [code] tags added

  2. #2
    Certifiable AUGI Addict tedg's Avatar
    Join Date
    2005-06
    Location
    in the upper right corner
    Posts
    3,507
    Login to Give a bone
    0

    Default Re: 2016 AutoCAD basic Lisp help requested

    Quote Originally Posted by shoemark.peter729551 View Post
    I think I have the worlds most basic lsp to set dimension styles and just can't get it to run when called from another routine.
    My code;
    Code:
    (defun c:10mm ()
    	(setvar "DIMSCALE" 10)
    	(COMMAND "-DIMSTYLE" "SAVE" "10mm" "y")   
    )
    I want it to override the current version of 10mm dimstyle so I need the "y".
    The problem arises at the "y" bit, as below;
    Command: 10mm
    Current dimension style: STANDARD Annotative: No
    Unable to recognize command "y". Please try again."y"

    However if I just paste the line containing the "y" as below at the command line, it works fine.
    (COMMAND "-DIMSTYLE" "SAVE" "10mm" "y")

    Any suggestions??
    Try this:
    Code:
    (defun c:10mm ()
    (setvar "dimscale" 10)
    (command "-dimstyle" "save" "10mm")
    (princ)
    )

  3. #3
    Login to Give a bone
    0

    Default Re: 2016 AutoCAD basic Lisp help requested

    Thanks for the reply.
    To explain a little further, my routine must overwrite the existing as we have 'fiddlers' who insist on playing with dim settings to suit themselves, so even though the current version (and yours) creates successfully, it doesnt overwrite a dimstyle once created..
    Each time the 'fiddlers' select from the pulldown menu, my routine is supposed to force an overwrite.

  4. #4
    Certifiable AUGI Addict tedg's Avatar
    Join Date
    2005-06
    Location
    in the upper right corner
    Posts
    3,507
    Login to Give a bone
    0

    Default Re: 2016 AutoCAD basic Lisp help requested

    Quote Originally Posted by shoemark.peter729551 View Post
    Thanks for the reply.
    To explain a little further, my routine must overwrite the existing as we have 'fiddlers' who insist on playing with dim settings to suit themselves, so even though the current version (and yours) creates successfully, it doesnt overwrite a dimstyle once created..
    Each time the 'fiddlers' select from the pulldown menu, my routine is supposed to force an overwrite.
    Ok here's a refined version based on what you mentioned.
    Code:
    (defun c:10mm ()
    (setvar "dimscale" 10)
    (if (= (tblsearch "dimstyle" "10mm") nil) ;; looks for style named 10mm
    (command "-dimstyle" "save" "10mm") ;; if nil, saves it to 10mm
    (command "-dimstyle" "save" "10mm" "y")) ;; if not nil (it exists) redefines 10mm
    (princ)
    )
    Hope that helps

  5. #5
    All AUGI, all the time
    Join Date
    2003-07
    Posts
    560
    Login to Give a bone
    0

    Default Re: 2016 AutoCAD basic Lisp help requested

    With multi users is there a company standard ? This is rule number one and you need management to insist.

    I supervised 6 designers and would not name and shame but would let everyone know about company stds not being kept.

  6. #6
    Certifiable AUGI Addict tedg's Avatar
    Join Date
    2005-06
    Location
    in the upper right corner
    Posts
    3,507
    Login to Give a bone
    0

    Default Re: 2016 AutoCAD basic Lisp help requested

    Quote Originally Posted by BIG-AL View Post
    With multi users is there a company standard ? This is rule number one and you need management to insist.

    I supervised 6 designers and would not name and shame but would let everyone know about company stds not being kept.
    Yes very true, that's what CAD QC is for.
    Periodic checking for company standards, and REJECT them for violations such as this.
    They will eventually get the hint when they keep getting stuff to fix and/or bad performance reviews.

    If nothing else, like you mention.. keep bringing it up to the group.

Similar Threads

  1. 2016: Inventor Check In Trouble with Vault Basic 2016
    By jnewton534097 in forum Inventor - General
    Replies: 2
    Last Post: 2016-04-25, 04:53 PM
  2. 2016: Publish command is slow to open in AutoCAD 2016 & AutoCAD 2016 LT
    By leinsterlady in forum AutoCAD Plotting
    Replies: 3
    Last Post: 2015-07-14, 07:42 PM
  3. 3dsmax 2016 / maya 2016
    By METANAMORPHOSE in forum 3ds Max - General
    Replies: 0
    Last Post: 2015-04-15, 09:58 AM
  4. can you create plans in revit? basic basic
    By comical_wenger in forum Revit Architecture - General
    Replies: 5
    Last Post: 2009-06-22, 01:36 PM
  5. Brick Lisp modification requested
    By BCrouse in forum AutoLISP
    Replies: 0
    Last Post: 2008-04-17, 08:15 PM

Tags for this Thread

Posting Permissions

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