/* 22.11.16 22:55 N. Vischer Opens selected object, adds a constriction line of zero length at the middle of the "Dia" line, closes object and re-selects it. If "Constr" already exists, an error message appears. Can be used in combination with "Navigate" macros. Note: Installing macro before the ObjectJ menu was visible causes an "Unidentified Identifier" error. In this case, bring macro window to front and choose "Macros>Install Macros" again. */ macro "Add Zero Length Constriction [9]"{ obj = ojSelectedObject(); if(obj == 0) exit ("No object is selected"); if(ojNItems("Constr") > 0) exit ("Constriction already exists"); ojSelectItem("Dia", 1); x = (ojXPos(1) +ojXPos(2))/2; y = (ojYPos(1) +ojYPos(2))/2; ojOpenObject(obj); ojSwitchToItem("Constr"); ojSetMarker(x, y); ojSetMarker(x, y); ojCloseObject(); ojSelectObject(obj); }