Howto: Extracting distances from text strings...

Discussion in 'AutoCAD' started by CraigV\(fs\), Oct 8, 2004.

  1. CraigV\(fs\)

    CraigV\(fs\) Guest

    I'd like to add up several dimension strings to verify the values. I need a
    little help getting through this part, though. I'd like to account for
    every time a dimension value has an override or is affected by the DIMRND
    variable (measures 5'-2 7/16", but displays 5'-2" instead).

    So what I need is a subroutine when given a string, returns a numeric value.

    Example situations:

    "Length varies" returns nil
    "5'-3"" returns a numeric value like 63 or 5'-3"
    "Prefix 5'-3"" disregards the prefix test and returns a numeric value
    "5'-3" Suffix" disregards everything after encountering the first numeric
    value and returns the numeric value


    I'm kind of a newbie to VBA, so I would appreciate your help.

    Craig
     
    CraigV\(fs\), Oct 8, 2004
    #1
  2. CraigV\(fs\)

    Ed Jobe Guest

    Instead of messing with all the variables, why not just get the actual
    distance. The dimension's Measurement prop returns a double.
     
    Ed Jobe, Oct 11, 2004
    #2
  3. CraigV\(fs\)

    CraigV\(fs\) Guest

    That is just it. I need to test the "displayed" value against the actual
    "measurement" value to see if rounding or .TextOverrides are causing
    dimension "busts".

    I come from a background where you are expected to draw accurately. My new
    firm tends toward "fast" and "dirty", consequently, all dimension strings
    are checked by hand. I'm just trying to come up with a routine to quickly
    point out the problem dimensions.

    When I get something that works, I'll post it to get some feedback.
     
    CraigV\(fs\), Oct 11, 2004
    #3
  4. CraigV\(fs\)

    Ed Jobe Guest

    What have you got so far?
     
    Ed Jobe, Oct 11, 2004
    #4
  5. CraigV\(fs\)

    CraigV\(fs\) Guest

    I flowcharted it on paper this weekend, but since the boot drive on my home
    computer went "*kaput*" last night, I've had XP installation on my mind
    instead...

    I'll see if I can get something on here by the end of the week. BTW- thanks
    for the interest.

    Craig
     
    CraigV\(fs\), Oct 11, 2004
    #5
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.