Results 1 to 10 of 10

Thread: Add tolerances to dimensions

  1. #1
    Certifiable AUGI Addict robert.1.hall72202's Avatar
    Join Date
    2004-07
    Location
    Detroit Michigan
    Posts
    2,508
    Login to Give a bone
    0

    Question Add tolerances to dimensions

    I want to make a lisp for creating tolerances as I use the same tolerances on
    a daily basis. I want to try my hand at creating the lisp myself (imagine that).
    I think I can do this......I will post my code when Im done. Question I have, is
    what variables are used for the Tolerance. I cant seem to find where the values
    for individual dimensions are stored. Please help.

  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: Add tolerances to dimensions

    The Properties palatte tells you the system variable names.

  3. #3
    Certifiable AUGI Addict robert.1.hall72202's Avatar
    Join Date
    2004-07
    Location
    Detroit Michigan
    Posts
    2,508
    Login to Give a bone
    0

    Default Re: Add tolerances to dimensions

    Thanks, I see it, Dimtol, Dimlim, etc.

  4. #4
    Certifiable AUGI Addict robert.1.hall72202's Avatar
    Join Date
    2004-07
    Location
    Detroit Michigan
    Posts
    2,508
    Login to Give a bone
    0

    Default Re: Add tolerances to dimensions

    Here is what I have:

    (defun c:T2 ()
    (command "dimtol" "on")
    (command "dimtm" "2")
    (command "dimtp" "2")
    (command "dim" "update" pause)
    (command "dimtol" "off")
    (princ)
    )

    This works, however, it does not set dimtol back to off......
    Can somebody show me how to do that????
    Last edited by Robert.Hall; 2004-11-17 at 03:14 PM.

  5. #5
    Active Member tuomo.jarvinen's Avatar
    Join Date
    2015-09
    Location
    Jyväskylä, Finland
    Posts
    53
    Login to Give a bone
    0

    Default Re: Add tolerances to dimensions

    How about:

    (defun c:T2 ()
    (command "dimtol" "on")
    (command "dimtm" "2")
    (command "dimtp" "2")
    (command "dim" "update" pause "" "exit")
    (command "dimtol" "off")
    (princ)
    )

  6. #6
    Certifiable AUGI Addict robert.1.hall72202's Avatar
    Join Date
    2004-07
    Location
    Detroit Michigan
    Posts
    2,508
    Login to Give a bone
    0

    Default Re: Add tolerances to dimensions

    That doesn't quite work either.....rather than pause for user input, it is
    trying to enter dimtol when you are supose to pick the dimension.

    Maybe a better version would select the dimension first and then ask for
    a tolerance variable which will then be passed to the dimension.

    Help??? Im lost with this...


    defun c:T2 ()
    (setq D (ssget :s)
    tolerance (getreal "tolerance:")
    )
    (command "dimtol" "on")
    (command "dimtm" tolerance "")
    (command "dimtp" tolerance "")
    (command "dim" "update" "D" "")
    (command "dimtol" "off")
    (princ)
    Last edited by Robert.Hall; 2004-11-18 at 09:11 PM.

  7. #7
    The Silent Type Mike.Perry's Avatar
    Join Date
    2000-11
    Posts
    13,657
    Login to Give a bone
    0

    Default Re: Add tolerances to dimensions

    Hi

    Why not simply modify the DimAddRef one from an earlier thread...

    Add text "REF" to dimensions
    Code:
    (defun c:DimTolerance (/ Save_DimTol Save_DimTm Save_DimTp DimObject)
      (setq Save_DimTol (getvar "DimTol"))
      (setq Save_DimTm (getvar "DimTm"))
      (setq Save_DimTp (getvar "DimTp"))
      (setvar "DimTol" 1)
      (setvar "DimTm" 2)
      (setvar "DimTp" 2)
      (princ "\nSelect Dimension to add Tolerance to: ")
      (setq DimObject (ssget '((0 . "DIMENSION"))))
      (if DimObject
    	(command "._-DimStyle" "_A" DimObject "")
      )
      (setvar "DimTol" Save_DimTol)
      (setvar "DimTm" Save_DimTm)
      (setvar "DimTp" Save_DimTp)
      (princ)
    )
    Have a good one, Mike
    Last edited by Mike.Perry; 2007-01-12 at 08:15 AM. Reason: Fix link.

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

    Default Re: Add tolerances to dimensions

    rhall, do not give up ! Try this :
    Code:
    (defun c:T2 ( )
      (command "dimtol" "on" )
      (command "dimtm" "2" )
      (command "dimtp" "2" )
      (princ "\nSelect objects : " )
      (command "-dimstyle" "a"
        (while (= (getvar "CMDACTIVE") 1 ) (command pause) )
      )
      (command "dimtol" "off" )
      (princ)
    )
    : ) Happy Computing !

    kennet

  9. #9
    Certifiable AUGI Addict robert.1.hall72202's Avatar
    Join Date
    2004-07
    Location
    Detroit Michigan
    Posts
    2,508
    Login to Give a bone
    0

    Default Re: Add tolerances to dimensions

    I thought about adding it as a dim overide which would be easiest....most of my drawings have been created with symetrical tolerances so it would not work.

    Both of these routines work great, thanks a bunch.

    So in Mike's the current variables are saved and then reset??
    I will have to try that in some of my other routines.

    In the other lisp, I am still unsure what CMD does??

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

    Default Re: Add tolerances to dimensions

    Hi again rhall,

    In a lisp there You are running for example the command pline, You do not know how many vertex the user is going to insert. Instead of typing pause pause pause how many times ? CMDACTIVE can check if the command pline is still active, and do a pause for the next users input. If the command pline is not more active the next line in the lisp will continue. CMDACTIVE can identify if an ordinary command, transparent command, script, lisp or a dialog box is active. It is very useful when You do not know how many user input You have to expect. You can use it with "while"or "if" statement. Please see the help file [F1].

    If You are using a lot of "dim override" I am strongly recommended You to create a second dimensionstyle, You can mess up a drawing in regeneration time with half an hour or more ( I have tested examples with both kind of dimension styles in AutoCAD 2002 ), and I suppose that AutoCAD only do like a small amount of "dim overrides". So why not use a second dimensionstyle when it is so easy to afterwords use the "brush" _matchprop to change from one dimensionstyle to an other, or set the right dimensionstyle before dimensioning. Time is money ; )

    : ) Happy computing !

    kennet
    Last edited by kennet.sjoberg; 2004-11-20 at 08:33 AM.

Similar Threads

  1. 2013: Export DWG tolerances
    By damon.sidel in forum Revit Architecture - General
    Replies: 1
    Last Post: 2014-03-10, 05:37 PM
  2. Variable precision and tolerances in dimensions
    By autocad.wishlist1734 in forum AutoCAD Wish List
    Replies: 2
    Last Post: 2013-12-14, 05:11 AM
  3. Tolerances Controlled by Holes Tolerances.xls
    By inventor.wishlist1738 in forum Inventor Wish List
    Replies: 0
    Last Post: 2006-05-06, 04:24 AM
  4. Constraints with Tolerances
    By inventor.wishlist1738 in forum Inventor Wish List
    Replies: 0
    Last Post: 2006-04-12, 05:03 AM
  5. Replies: 3
    Last Post: 2006-01-23, 07:13 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
  •