jmarkus
Mechanical
- Jul 11, 2001
- 377
I have a CATscript which is looping through lines on a drawing (the lines belong to some titleblock geometry) and extracting the start point (origin) of the lines.
For some reason, the results are not correct. For example, I have a line which I can manually check (double click on the line) and the end points of the line are correctly reported as (241.8, 26) & (421.8, 26), but the code returns the origin as (-685.8, 26). Since this line is on a drawing sheet, it is even stranger that it is returning a negative value for the X-coordinate.
The excerpt from my code is:
Although my example shows the X-coordinate as negative (which belonged to a horizontal line), I also have vertical lines reporting negative Y-coordinates by the code (but, again, not when checked manually).
If anyone has some insight as to why this might be happening, or what I should check (does the drafting sheet use a different axis system?), then it would be much appreciated!
Thanks,
Jeff
For some reason, the results are not correct. For example, I have a line which I can manually check (double click on the line) and the end points of the line are correctly reported as (241.8, 26) & (421.8, 26), but the code returns the origin as (-685.8, 26). Since this line is on a drawing sheet, it is even stranger that it is returning a negative value for the X-coordinate.
The excerpt from my code is:
Code:
For Each TheGeom in GeomElems
[indent]If TypeName(TheGeom)="Line2D" then
[indent]TheGeom.GetOrigin(Org)
TheGeom.GetDirection(Dir)
MsgBox ("Origin: " & Org(0) & ", " & Org(1) & vbCrlf & "Direction: " & Dir(0) & ", " & Dir(1))
[/indent]
End If[/indent]
Next
Although my example shows the X-coordinate as negative (which belonged to a horizontal line), I also have vertical lines reporting negative Y-coordinates by the code (but, again, not when checked manually).
If anyone has some insight as to why this might be happening, or what I should check (does the drafting sheet use a different axis system?), then it would be much appreciated!
Thanks,
Jeff