Howto: Extracting distances from text strings...

Howto: Extracting distances from text strings...

Anonymous
Not applicable
263 Views
4 Replies
Message 1 of 5

Howto: Extracting distances from text strings...

Anonymous
Not applicable
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
0 Likes
264 Views
4 Replies
Replies (4)
Message 2 of 5

Anonymous
Not applicable
Instead of messing with all the variables, why not just get the actual distance. The dimension's Measurement prop returns a double. -- ---- Ed ---- "CraigV(fs)" wrote in message news:4166ccd9_1@newsprd01... > 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 > >
0 Likes
Message 3 of 5

Anonymous
Not applicable
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.
0 Likes
Message 4 of 5

Anonymous
Not applicable
What have you got so far? -- ---- Ed ---- "CraigV(fs)" wrote in message news:416ae141_3@newsprd01... > 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. > >
0 Likes
Message 5 of 5

Anonymous
Not applicable
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 "Ed Jobe" wrote in message news:416aecc8_3@newsprd01... > What have you got so far? > > -- > ---- > Ed > ---- > "CraigV(fs)" wrote in message > news:416ae141_3@newsprd01... >> 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. >> >> > >
0 Likes