helmut Posted November 14, 2011 Share Posted November 14, 2011 hi folks, based on a piece of code that was discussed here before (sorry, I cannot find the threat any more) I tried to create the following tool: -- an elevation benchmark ("h?henkote" in german) with symbols of my own -- two different symbols can be chosen depending on the position above or below the respective elevation point -- first click after activation of tool shows reference for zero elevation -- all following clicks place instances of the symbol, befilled with the elevation higth as plain text -- the system shall work in any rotated screen position so far, so good... a couple of questions remain: -- when terminating by using keys "x" or "escape" all instances of my symbols disappear; when terminating by activating another command, e.g. drawing a line, all instances are kept; why does this happen ? -- how could I achieve to place real plug-ins instead of symbols - with still changeable properties AFTER creation - such as changing the symbol type from "above" to "below" and still keeping the elevation higth... obviously there is something with plug-in creation I don?t understand... ------------------------------------------------------------------- PROCEDURE h?henkote; CONST ElevClass = 'bemassung'; ElevRec = 'h?henkote schnitt'; ElevFld = 'kote'; VAR ElevSym : STRING; x1, y1 : REAL; x2, y2 : REAL; x3, y3 : REAL; x4, y4 : REAL; CurrentCl : STRING; vorzeichen: STRING; BEGIN DSelectAll; PushAttrs; { save graphic state } CurrentCl := ActiveClass; NameClass(ElevClass); SetClUseGraphic(ElevClass, true); SetClPenFore(ElevClass, 0, 0, 0); SetClPenBack(ElevClass, 0, 0, 0); SetClLW(ElevClass, 1); SetClLS(ElevClass, 5); SetClFPat(ElevClass, 0); ShowClass(ElevClass); LSByClass; LWByClass; PenColorByClass; FillColorByClass; FPatByClass; PopAttrs; { restore graphic state } ElevSym:=psymbolname; GetPt(x3, y3); { This is where the reference elevation is stored } x4:=x3; y4:=y3; ModelPt2DToScreenPt (x4, y4); WHILE TRUE DO BEGIN NameClass(CurrentCl); { return to current class } GetPt(x1, y1); { Elevation marker will be placed at this point } x2:=x1; y2:=y1; ModelPt2DToScreenPt (x2, y2); NameClass(ElevClass); { Elev symbol instance goes in this class } SYMBOL(ElevSym, x1, y1, -GETPREFREAL(93)); vorzeichen:=''; IF (y2-y4)>0 THEN vorzeichen:='+'; IF (y2-y4)=0 THEN vorzeichen:='?'; SetRecord(LNewObj, ElevRec); SetRField(LNewObj, ElevRec, ElevFld, concat(vorzeichen, Num2Str(2,(y2 - y4)/100))); SetRField(LNewObj, ElevRec, 'zeile1', ''); SetRField(LNewObj, ElevRec, 'zeile2', ''); RedrawAll; DSelectAll END; { WHILE } END; Run(h?henkote); ------------------------------------------------------------------- thanks in advance for suggestions ! helmut Quote Link to comment
Dexie Posted December 1, 2011 Share Posted December 1, 2011 Does'nt the Stake Object tool provide this functionality? Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.