Looking for: dimension string check routine

Discussion in 'AutoCAD' started by CraigV\(fs\), Jul 28, 2004.

  1. CraigV\(fs\)

    CraigV\(fs\) Guest

    My new firm allows the use of rounding in dimension styles (DIMRND
    variable). I've always tried to draw things precisely.

    As a result, they have somebody manually check floor plan dimension strings
    for each project. This seems like a waste of time.

    Has somebody written a routine that can "check" dimension strings? Just
    grab all of the dimensions in a string, and it would tell you what the
    numbers add up to? Then you can verify that against the actual dimension...

    Thanks.
     
    CraigV\(fs\), Jul 28, 2004
    #1
  2. CraigV\(fs\)

    wccppp Guest

    Post a sample of that kind of strings you want to check? What format are they? Decimal? Architectural?
     
    wccppp, Jul 28, 2004
    #2
  3. Maybe this function will help you. Just pass it
    a selection set of dimension objects.

    (defun addDims (ss / i object values)
    (setq i 0)
    (repeat (sslength ss)
    (setq object (vlax-ename->vla-object (ssname ss i)))
    (setq values (cons (vla-get-measurement object) values))
    (setq i (1+ i)) )
    (apply '+ values)
    )
     
    Jason Piercey, Jul 28, 2004
    #3
  4. CraigV\(fs\)

    GaryDF Guest

    Try this one, works great.

    ;;;Peter Jamtgaard
    (defun ADIMIT (/ CNT ENAM EOBJ SSET)
    (prompt
    "\n* Select All Dimensions to Total in Imperial Units *"
    )
    (setq CNT 0
    SUM 0
    )
    (if (setq SSET (ssget (list (cons 0 "DIMENSION"))))
    (progn
    (command ".dim1" "update" SSET "")
    ;;added this line
    (repeat (sslength SSET)
    (setq ENAM (ssname SSET CNT)
    CNT (1+ CNT)
    EOBJ (vlax-ename->vla-object ENAM)
    )
    (vl-catch-all-apply
    '(lambda (X) (setq SUM (+ SUM (vla-get-measurement X))))
    (list EOBJ)
    )
    )
    ;;(princ (strcat "\n" (rtos SUM 4 6)))
    (princ (strcat "\n* Total Dimension = " (rtos SUM 4 6) " *")
    )
    )
    )
    (prin1)
    )
     
    GaryDF, Jul 28, 2004
    #4
  5. I misunderstood the question (obviously). It could
    certainly be done, right now I've got to much "real"
    work on the table to examine it any further. In the
    meantime, maybe Tim's modifications will get you
    what you need.
     
    Jason Piercey, Jul 29, 2004
    #5
  6. CraigV\(fs\)

    CraigV\(fs\) Guest

    Thanks, to all of you guys for spending the time on this routine. It works
    great.

    It is people like you that make these newsgroups invaluable.

    Craig
     
    CraigV\(fs\), Jul 29, 2004
    #6
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.