Line parameter (@param line)
The line parameter type makes the parameter dialog open a border/line editor: color, weight (pt), dash style and visibility in one control — with a live preview. The script receives a ready-made LineSpec and applies it to a shape's outline.
Syntax
// @param line <name> "<Label>" [default="<color>,<weight>,<dash>"] [tooltip="…"]
- default — initial value as
Color,Weight,Dash. - Color:
#RRGGBB— ornonefor no border. - Weight: points (e.g.
1.5,2.25). - Dash:
solid·dash·dot/rounddot·squaredot·dashdot·longdash. - Examples:
default="#000000,1.5,solid"·default="#0070C0,2.25,dash"·default="none" - In the script,
Params.GetLine("<name>")returns aLineSpecwithColor,Weight(pt),Dash(MsoLineDashStyle),Visible.
Apply
The helper ppptools.SetLine(shape, spec) sets color, weight, dash and visibility in one call:
// @param line Rahmen "Border" default="#0070C0,2.25,dash" tooltip="Border of the selected shapes"
// @button Apply
var b = Params.GetLine("Rahmen");
var sel = ppptools.GetSelectedRange();
for (int i = 1; i <= sel.Count; i++)
ppptools.SetLine(sel[i], b);
When run, the dialog shows a small line preview next to the "Bearbeiten…" button. Clicking it opens the editor with color · weight · dash · visible.
Remove the border
Turn visible off in the editor (or use default="none") to hide the outline — handy for a "remove border" snippet.
Individual properties
You can also use the LineSpec partially — e.g. apply only the weight and leave color/dash untouched:
var b = Params.GetLine("Rahmen");
sel[i].Line.Weight = b.Weight; // weight only
| Property | Access |
|---|---|
| Color | b.Color (System.Drawing.Color) |
| Weight (pt) | b.Weight |
| Dash | b.Dash (MsoLineDashStyle) |
| Visible | b.Visible |