Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

CATScript - Some Point2Ds on Drawing sheet not updating on screen after SetData

Status
Not open for further replies.

jmarkus

Mechanical
Jul 11, 2001
377
0
16
CA
Hi,

This is indirectly related to this thread, in that it is part of the same CATScript.

The following code moves the Point2D objects by DeltaX(i) & DeltaY(i) if the object is found in a specified area on the background view of a drawing sheet:

Code:
If TypeName(TheGeom)="Point2D" then				
[indent]TheGeom.GetCoordinates(Org)
If (Org(0) >= X1(i) And Org(0) <= X2(i) And Org(1) >= Y1(i) And Org(1) <= Y2(i)) then
[indent]TheGeom.SetData Org(0)+ DeltaX(i),Org(1)+ DeltaY(i)
TheGeom.GetCoordinates(Org)
fileObj.WriteLine("Moved to " & Org(0) & ", " & Org(1) & vbcrlf)
[/indent]
End If[/indent]
End If

While the script is running, I am dumping out a text file of the new coordinates. After the script is complete, most of the points have moved to the correct new coordinates, but some have not - despite the fact that the text file shows the correct new coordinates for all points. Those that have not moved correctly appear to have only moved by either DeltaX(i) or DeltaY(i), but not by both. I also invoke the Sketch Analysis command at the end of the script. I do this because it forces an update of lines which are associated with these points, which otherwise would appear in the wrong place without doing this. When the Sketch Analysis dialog is active, I can see the markers (identifying the geometry under analysis) of the points in the correct locations (even though the points themselves are not). When I close and reopen the Sketch Analysis dialog after the script is complete the markers have reverted back to the same locations as the points. In the attached image, some of the points in question are red (at the bottom) and the related markers are blue (at the top - you can also see other 'ghost' markers without points or lines).
Ghost_points_nwvwls.png


I cannot figure out why this would happen at all, and especially why it would happen for some points but not for others. I have tried forcing view updates and display refreshes to no avail. Hopefully someone can help point me in the right direction.

Thanks,
Jeff
 
Status
Not open for further replies.
Back
Top