X coordinate of AcadDimAligned returning wrong value

X coordinate of AcadDimAligned returning wrong value

Anonymous
Not applicable
369 Views
2 Replies
Message 1 of 3

X coordinate of AcadDimAligned returning wrong value

Anonymous
Not applicable
Watch : : controlX : 5.6843418860808E-14 : Double :
mDimTools.dimPatternCheck


ADT3.3 Acad02

Hi All,

I have an AcadDimAligned who's start point X coordinate
is 0. Sometimes I am getting the above E value when
capturing this value instead of 0. Not always sometimes
it works fine. All the work is done in the WCS.

Portion of code is below. All it does is create a SS of all
AcadDimAligned on a certian layer "ZFrontDim" in this
case. Then loops to find lowest X coord of all dim's start
points.

Anyone know the problem?

Thanks,
Paul

[code]
Dim ssFront As AcadSelectionSet
Dim i As Integer
Dim dimElevation As Double
Dim dimAli As AcadDimAligned
Dim controlX As Double' I tried a variant as well same results.


Set ssFront = mADTools.ssDims_ByLayer("Dims", "ZFrontDim")

For i = 0 To ssFront.Count - 1

If TypeOf ssFront(i) Is AcadDimAligned Then

Set dimAli = ssFront(i)

If i = 0 Then
'getting above E value here sometimes. Checking
'the dims startpoint on the screen gives proper
'X coord which is 0
controlX = dimAli.ExtLine1Point(0)
End If

If dimAli.ExtLine1Point(0) < controlX Then

controlX = dimAli.ExtLine1Point(0)
Exit For

End If

End If

Next i
[/code]
0 Likes
370 Views
2 Replies
Replies (2)
Message 2 of 3

Anonymous
Not applicable
http://www.google.com/search?q=comparing+floating+point+numbers&btnG=Search

http://www.cygnus-software.com/papers/comparingfloats/comparingfloats.htm
0 Likes
Message 3 of 3

Anonymous
Not applicable
Sorry, It was just a rounding issue.

Scientific Notation: 5.6843418860808E-14
Regular Notation: .0000000000568434188
Close to 0



"Paul Richardson" wrote in message
news:4845796@discussion.autodesk.com...
Watch : : controlX : 5.6843418860808E-14 : Double :
mDimTools.dimPatternCheck


ADT3.3 Acad02

Hi All,

I have an AcadDimAligned who's start point X coordinate
is 0. Sometimes I am getting the above E value when
capturing this value instead of 0. Not always sometimes
it works fine. All the work is done in the WCS.

Portion of code is below. All it does is create a SS of all
AcadDimAligned on a certian layer "ZFrontDim" in this
case. Then loops to find lowest X coord of all dim's start
points.

Anyone know the problem?

Thanks,
Paul

[code]
Dim ssFront As AcadSelectionSet
Dim i As Integer
Dim dimElevation As Double
Dim dimAli As AcadDimAligned
Dim controlX As Double' I tried a variant as well same results.


Set ssFront = mADTools.ssDims_ByLayer("Dims", "ZFrontDim")

For i = 0 To ssFront.Count - 1

If TypeOf ssFront(i) Is AcadDimAligned Then

Set dimAli = ssFront(i)

If i = 0 Then
'getting above E value here sometimes. Checking
'the dims startpoint on the screen gives proper
'X coord which is 0
controlX = dimAli.ExtLine1Point(0)
End If

If dimAli.ExtLine1Point(0) < controlX Then

controlX = dimAli.ExtLine1Point(0)
Exit For

End If

End If

Next i
[/code]
0 Likes