rem Written by Brian Ott & Hans Winkler :START ARRAY newldr[5][17] ARRAY nwitln[1][8] ARRAY POS[6][2] ARRAY ll[20] A=0 B=0 C=0 ANUM=0 :picklabel SET mask, 15, 16 GETCUR "Select the Label or Note to be modified", 1, 0,,,,,,"Prog Info" if ((@key == -3)||(@key == -2)) goto exit if (@key == -1) goto exit if (@key == 1) reg_code = 1 if (@key == 1) goto reg_screen GETENTXY @xview, @yview, entype,, id if (@error == 1) pause "Entity not found... to continue" if (@error == 1) goto picklabel :text_coordinates x1 = @fltdat[0] y1 = @fltdat[1] z1 = @fltdat[2] hanc = @txtinfo[4] vanc = @txtinfo[5] :posmenuoption menopt = 1 :POSITION getpos "Indicate new Arrows, without pick for none:", menopt if (@key == -3) goto exit if (@key == -2) goto START if (@key == -1) goto NOTETEST menopt = @key POS[ANUM][0] = @xview POS[ANUM][1] = @yview IF (ANUM == 5) pause "You are only allowed to specify 5 Arrows max", ANUM IF (ANUM == 5) ANUM = -1 ANUM = ANUM+1 goto POSITION :NOTETEST if ((entype == 15) && (ANUM == 0)) goto exit if (ANUM == 0) goto ANCHOR if (entype == 16) goto ASSIGN :NOTEASSIGN NH2 = @txtatt[6] NH = NH2/2 nwitln[0][0] = x1 - NH nwitln[0][1] = y1 + NH nwitln[0][2] = x1 - (NH*2) nwitln[0][3] = y1 + NH nwitln[0][4] = @entatt[5] nwitln[0][5] = @entatt[6] nwitln[0][6] = @entatt[3] nwitln[0][7] = @entatt[1] ARRAY nldrln[1][17] nldrln[0][0] = nwitln[0][2] nldrln[0][1] = nwitln[0][3] nldrln[0][2] = 1 nldrln[0][3] = 1 nldrln[0][4] = @entatt[5] nldrln[0][5] = @entatt[6] nldrln[0][6] = @entatt[3] nldrln[0][7] = @entatt[1] nldrln[0][8] = 1 nldrln[0][9] = 1 nldrln[0][10] = 1 nldrln[0][11] = @txtatt[6] nldrln[0][12] = 0 nldrln[0][13] = 0 nldrln[0][14] = 0 nldrln[0][15] = 0 nldrln[0][16] = 0 if (@txtatt[1] == 1) nldrln[0][12] = 1 :ASSIGNNOTE newldr[A][B] = nldrln[0][B] B=B+1 IF (B==17) A=A+1 IF ((B==17) && (A == ANUM)) goto NEWLEADER IF (B==17) B=0 GOTO ASSIGNNOTE :ASSIGN newldr[A][B] = @ldrln[0][B] B=B+1 IF (B==17) A=A+1 IF ((B==17) && (A == ANUM)) goto NEWLEADER IF (B==17) B=0 goto ASSIGN :NEWLEADER newldr[C][2] = newldr[C][8] = POS[C][0] newldr[C][3] = newldr[C][9] = POS[C][1] C=C+1 if (C == ANUM) goto ANCHOR goto NEWLEADER :ANCHOR call strlen, @strdat, lngth ht = @txtatt[6] asp = @txtatt[7] spcfac = @txtatt[8] spc = (ht * spcfac) width = (ht * asp) slant = (abs(@txtatt[4])) slspc = (asp *(tan(slant)) * (2.25 * ht)) if (hanc == 1) slspc = slspc/2 ct = -1 lnum = 1 lett = 0 :LINES ct = ct + 1 if (@strdat[ct] == 10) ll[lnum] = lett if ((@strdat[ct] == 10)&&(ct == (lngth-1))) goto VANCHOR if (ct == lngth) ll[lnum] = lett if (ct == lngth) goto VANCHOR if (@strdat[ct] == 10) lnum = lnum + 1 if (@strdat[ct] == 10) lett = 0 if (@strdat[ct] == 10) goto LINES lett = lett + 1 goto LINES :VANCHOR vanc = @txtinfo[5] vdis = (ht + spc) * (lnum-1) if (vanc == 1) vdis = (((((lnum) * ht) + (spc * (lnum - 1))) / 2)-ht) if (vanc == 2) vdis = -ht if ((vanc == 1) && (ANUM ==0)) vdis = (((((lnum) * ht) + (spc * (lnum - 1))) / 2)-(ht/2)) if ((vanc == 2) && (ANUM ==0)) vdis = 0 ct1 = 1 ct2 = 1 ct3 = 0 :LONGEST if (ll[ct1] >= ll[ct2]) ct3 = ct3 + 1 if (ct3 == lnum) goto HORANC if (ct2 == lnum) ct3 = 0 if (ct2 == lnum) ct1 = ct1 + 1 if (ct2 == lnum) ct2 = 0 ct2 = ct2 + 1 goto LONGEST :HORANC hdis = 0 if (hanc == 0) goto LABEL if (ANUM == 0) goto LABEL if (hanc == 1) hdis = (width * (ll[ct1]/2) + slspc ) if (hanc == 2) hdis = (width * ll[ct1] + slspc) :LABEL x1 = (x1 - hdis ) y1= (y1 + vdis) delent id if (entype == 15) goto noteexe if (ANUM == 0) goto REMOVE :labelexe nlabel x1, y1, z1, @strdat, 1, @witln, ANUM, newldr, @txtinfo, @txtatt, @entatt goto exit :noteexe nlabel x1, y1, z1, @strdat, 1, nwitln, ANUM, newldr, @txtinfo, @txtatt, @entatt goto exit :REMOVE delent id nnote x1, y1, z1, @strdat, @txtinfo, @txtatt, @entatt :exit :sec_exit CLEAR newldr, nwitln, POS, ll, A, B, C, ANUM, entype, id, menopt, x1, y1, z1, hanc, vanc CLEAR NH2, NH, nldrln, lngth, ht, asp, spc, spcfac, width, slant, slspc, ct, lnum, lett CLEAR vdis, hdis, ct1, ct2, ct3 exit