Thanks Rick for this example - these things I do understand (and already experimented with), but how to create graphic objects directly?
I just want to draw a slanted line into the anchored frame. I struggle with the definition of the line properties. At the breakpoint the values are set (even the points), but nothing is drawn.
#target framemaker
var oDoc = app.ActiveDoc, oFrame, cm = 1857713;
Main(oDoc);
function Main(oDoc) {
if (!oDoc.ObjectValid()) { alert ("A document must be active."); return; } oFrame = oDoc.FirstSelectedGraphicInDoc; if (!oFrame.ObjectValid()) { alert ("An anchored frame must be selected."); return; }
DrawLine(oDoc);
}
function DrawLine (oDoc) {
var oLine = oDoc.NewLine, oPoints = [[1*cm, 1.5*cm],[5*cm, 1.75*cm]];
oLine.LocX = 1*cm; oLine.LocY = 1.5*cm; oLine.Points = oPoints; oLine.Width = 0.05*cm; // 0.5 mm oLine.Fill = 0; // full ? oLine.Color = 0; // black?
$.bp (true);
}