2007-03-12 11:53 AM
2007-03-12 09:07 PM
IF STRSTR(AC_DrawingScale, "1:1") > 0 THEN...This tests to see if the substring "1:1" is contained within the returned value.
2007-03-13 08:56 AM
2007-03-13 03:19 PM
2007-03-15 08:32 AM
2007-03-15 11:19 AM
So is it impossible to get values outYes: Impossible.
from <DRAWINGSCALE>
2007-03-15 03:50 PM
cejava1 wrote:I just looked closer and realized that you are using the autotext <DRAWINGSCALE> and not the parameter name DrawingScale (without the carets).
So is it impossible to get values out
from <DRAWINGSCALE> ??
2007-03-29 09:56 AM
2007-03-29 12:58 PM
!»» Example with automatic scale string of drawing stamps
scaleS=AC_DrawingScale
!»» CONVERT SCALE-STRING TO NUMERIC
scaleN=0
!»» Cut of "M" at the beginning. Not needed.
s=STRSTR(scaleS,"M")
IF s THEN scaleS=STRSUB(scaleS,s+1,STRLEN(scaleS)-s)
!»» Imperial or metric?
s=STRSTR(scaleS,"=")
!»» Converting ...
IF s THEN
!»» Scale notation is imperial
sts=SPLIT(STRSUB(scaleS,1,s-1),"%n",lengthR)
sts=SPLIT(STRSUB(scaleS,s+1,STRLEN(scaleS)-s),"%n",lengthP)
IF lengthR THEN scaleN=lengthP/lengthR ELSE scaleN=MAX(lengthP,0)
ELSE
!»» Scale notation is metric
IF NOT(scaleS="auto") THEN
s=STRSTR((scaleS,":")
IF s THEN
sts=SPLIT(STRSUB(scaleS,1,s-1),"%n",lengthR)
sts=SPLIT(STRSUB(scaleS,s+1,STRLEN(scaleS)-s),"%n",lengthP)
IF lengthR THEN scaleN=lengthP/lengthR ELSE scaleN=MAX(lengthP,0)
ELSE
sts=SPLIT(scaleS,"%n",scaleN)
ENDIF
ENDIF
ENDIF
!»» scaleN contains the divisor of the scale.
!»» CONVERT NUMERIC TO IMPERIAL NOTATION
IF scaleN<2000 AND NOT(scaleN>=100 AND FRA(scaleN/10)<0.001 ) THEN
scaleI=STR("%^.128fi",1" * 12/scaleN)+´=1'0"´
ELSE
scaleI=´1"=´+STR("%^.32ffi",scaleN*1")
ENDIF
!»» scaleI contains the imperial scale string.
!»» CONVERT NUMERIC TO METRIC NOTATION
praefix="M "
IF scaleN<1 THEN
scaleM=praefix+STR("%^.0m",1/scaleN)+":1"
ELSE
scaleM=praefix+"1:"+STR("%^.0m",scaleN)
ENDIF
!»» scaleM contains the metric scale string.
!»» PRINT RESULTS
txt="»»"+scaleS+"««"
txt=txt+" »»"+STR("%.3",scaleN)+"««"
txt=txt+" »»"+scaleI+"««"
txt=txt+" »»"+scaleM+"««"
TEXT2 0,0,txt
END
2007-03-29 02:11 PM