Sorry about the advertising, but that's how I get this FREE.
since 31st May, 2000
Last updated 9th Jan, 2001
DISCLAIMER: I'm not claiming originality here. Some are, some aren't. I'm just
putting them here because they are too handy NOT to be published!
Some handy strokes
layout.startup
In your ~/mgc/startup/layout.startup (or site specific layout.startup file)
//----------------------------------------------------------------------
// Strokes/Function Keys
//----------------------------------------------------------------------
// Note: I like to use the transcript modifier "INDIRECT" so as to keep
// the transcript replayable (in the event of a crash)
// Overwrites Mentor's "rotate components". Especially pertinent if the origin is
// not in the centre of your geometry!
//
function $stroke_3698741(), INDIRECT { $pivot_components(90, @center, @relative, @NoRepeat); }
// I use these commands so much it is handy to have a stroke for them
//
function $stroke_45654(), INDIRECT { $execute_measure(); }
function $stroke_95147(), INDIRECT { $view_previous(); }
function $stroke_21478963(), INDIRECT { $swap_components(); }
function $stroke_753(), INDIRECT { $zoom_out(4); }
// ...because zoom out 2 simply isn't enough!
// This stroke rotates reference designators. Really handy when cleaning up ref's
// before sending out to mfg. Also useful if defined for FABLINK.
//
function $stroke_3698741()
{
local what;
what = $get_sel_ref_count();
if (( what == "1" )) {
$writes_file($stdout, ($strcat('THIS IS A REFERENCE DESIGNATOR!', '' )),'\n');
local orient;
orient = $get_sel_ref_info();
if (((orient[7-1] == '0') || (orient[7-1] == '180'))) {
$set_active_window($get_active_geom_win_name());
$pivot_reference(90, @NoRepeat);
}
else {
$set_active_window($get_active_geom_win_name());
$pivot_reference(0, @NoRepeat);
}
}
else {
$rotate(90, @relative, @NoRepeat);
}
}
fablink.startup
//----------------------------------------------------------------------
// Strokes/Function Keys
//----------------------------------------------------------------------
// This group of functions enables you to pick (with the mouse) which geometry to
// add to your board. A damn site better than what Mentor offers (typing in the
// [often complicated] name of the geometry)
// I think you can blame Al Braunstein for these ones :-)
//
function $add_geometry_prompt(), invisible
{
$create_prompt( pcb_default_scope_name, @$add_geometry, "ADD GE",
$prompt_arg(@Geom_Name, "Geometry"),
$prompt_dynamic(@Geom_Name, "apl_get_geom_names()"),
$prompt_arg(@Ref_Name, "Reference", $prompt_optional_title_font,
$prompt_optional_field_font),
$prompt_arg(@Rotation, "Rotation"),
$prompt_arg(@Mirror, " "),
$prompt_arg(@Scale, "Scale", $prompt_optional_title_font,
$prompt_optional_field_font),
$prompt_arg(@Repeat, " "),
$prompt_arg(@Location, " "),
$prompt_dynamic(@Location,
"($prompt_for_add_geometry(Geom_Name, Rotation, Mirror, Scale))")
);
}
function apl_get_geom_names(geom_name : string), INVISIBLE
{
return geom_name;
}
function apl_get_geom_names_form(), INVISIBLE
{
local geom_name_g = $form_dynamic_list_box_gadget(@true,
"Choose a Geometry",
"helvetica-bold:18",
,
10,
@$get_form_geom_names);
local geom_name_g_site = $form_named_argument_gadget(@geom_name,
geom_name_g);
local form_layout = $form_column(@true, geom_name_g_site,
$form_execute_buttons()
);
$create_form($window_scope_name(),
@apl_get_geom_names,
@true, , form_layout);
}
Some recommended Mentor AMPLE & Userware links