'Bar Script.vbs 'Copyright 2007 - Infolytica Corporation '-------------------------------------------------------------------------------------------------- DIM x(4), y(4), Control(0), Name(0) newDocument 'Set up parameters for bar width = 1 height = 1 length = 3 'Specify center of the end of the bar, assume that z = 0 xcenter = 0 ycenter = 0 'Set up coordinates x(1) = xcenter - width/2 y(1) = ycenter - height/2 x(2) = x(1) + width y(2) = y(1) x(3) = x(2) y(3) = y(2) + height x(4) = x(1) y(4) = y(3) 'Now draw box For i = 1 to 4 j = i + 1 If j > 4 then j = j - 4 Call getDocument.newConstructionSliceLine(x(i),y(i),x(j),y(j)) Next 'Redraw object call getDocument.viewAll() 'Select box Control(0) = infoSliceSurface Call getDocument.getView.selectAt(xcenter, ycenter, infoSetSelection, Control) 'Create bar of copper Material = "Copper: 5.77e7 Siemens/meter" Name(0) = "Bar" Call getDocument.makeComponentInALine(length, Name,"Name=" & Material)