09-10-2015 07:30 AM
Hello,
I'm on Diadem 2012 and do a lot of calculations in VBS that save some time. As a cherry on top there is a generator that loads TDR report file and inserts data from channels as curves.
o2DCurve.Shape.XChannel.Reference that should insert the correct channel. However it does not:
I spotted the problem in the second it uploaded here...
This is caused by the "Joint x-channel" checkbox in lower-left. Is there a property that changes that? Right click in Report>Copy as Script does not show anythig of related name (to my eagle eye at least).
Solved! Go to Solution.
09-10-2015 09:52 PM
Hello cubz,
I think this might be the parameter you are looking for:
Report.ActiveSheet.Objects.Item.Settings.UseCommonXChannel = False
Example code (will delete your existing layout):
Dim oMy2DAxisSystem, oMyPos, oMy2DCurve1, oMy2DCurve2 Call Report.NewLayout() Set oMy2DAxisSystem = Report.ActiveSheet.Objects.Add(eReportObject2DAxisSystem, "My2DAxisSystem") Set oMyPos = oMy2DAxisSystem.Position.ByCoordinate oMyPos.X1 = 20 oMyPos.X2 = 80 oMyPos.Y1 = 20 oMyPos.Y2 = 80 Set oMy2DCurve1 = oMy2DaxisSystem.Curves2D.Add(e2DShapeLine, "MyNew2DCurve1") Set oMy2DCurve2 = oMy2DaxisSystem.Curves2D.Add(e2DShapeLine, "MyNew2DCurve2") oMy2DCurve1.Shape.XChannel.Reference = "[1]/[1]" oMy2DCurve1.Shape.YChannel.Reference = "[1]/[2]" oMy2DCurve2.Shape.YChannel.Reference = "[1]/[3]" oMy2DAxisSystem.Settings.UseCommonXChannel = True Call Report.Refresh()
I hope that's helpful,
Otmar
09-11-2015 02:07 AM
Hi Otmar,
yes, that's it. Thanks, now I can generate more of the reports without worries for the .TDR!
P.S: Friday note: the eReportObject2DAxisSystem is wrong when one copypaste the code you posted directly into Diadem.
Cheers,
c.