Read/Write: Returns/Sets via point data object the Offset location of the CAD Reporting Control
Visual Basic |
---|
Public Property Offset As PointData |
Returns a PointData object.
Gets the current offsets for the Cad Report Object and then adjusts offsets by new values based on user input:
Example (VBScript) | Copy Code |
---|---|
Dim DmisApp As Object Dim DmisPart As Object Dim DmisReport As Object Dim ReportPages As Object Dim ReportPage As Object Dim RepControls As Object Dim RepControl As Object Dim Offset As Object Dim I As Integer Dim val As Double Dim valX As Double Dim valY As Double Dim valZ As Double Sub Main2 Set DmisApp = CreateObject("PCDLRN.Application") Set DmisPart = DmisApp.ActivePartProgram Set DmisReport = DmisPart.ReportWindow Set ReportPages = DmisReport.Pages For Each ReportPage In ReportPages Set RepControls = ReportPage.ReportControls For I = 1 To RepControls.Count Set RepControl = RepControls.ItemControl(I) If (RepControl is Nothing) Then MsgBox "Nothing" Else If RepControl.Type = 26514 Then Set Offset = RepControl.Offset valx = offset.x valy = offset.y valz = offset.z MsgBox "Current offsets are: " & Chr(13) & Chr(10) & " x off =" & valx & Chr(13) & Chr(10) & " y off=" & valy & Chr(13) & Chr(10) & " z off=" & valz & Chr(13) & Chr(10),"CRO Offsets" intX = InputBox ("Type a value to adjust the X offset:", "CRO Offsets - X") intY = InputBox ("Type a value to adjust the Y offset:", "CRO Offsets - Y") intZ = InputBox ("Type a value to adjust the Z offset:", "CRO Offsets - Z") offset.x = valx + intX offset.y = valy + intY offset.x = valx + intZ RepControl.Offset = offset Set offset = Nothing End If End If Next I Next ReportPage DmisReport.RefreshReport Set ReportPages = Nothing Set DmisReport = Nothing Set DmisPart = Nothing Set DmisApp = Nothing End Sub Sub Main Main2 End Sub |