IvanAriel Posted July 20, 2011 Share Posted July 20, 2011 Hi everyone, I updated my old VW 11.5 to VW 2008, but I have a few problems with my old scripts. I was wondering if someone can give me a hand with this issue. Basically the script connects two groups of red polygons. It works perfect in VW 11.5 but now I cannot figure out why it doesn't work. Here is the script: Procedure Join_Groups; {debug} {reunit poligons rouges de 2 groupes, les reordone et fait un group general } VAR x,y: REAL; h,h1,h2,h3, hl: HANDLE; P1,P2,P3: POINT; n,i: INTEGER; r, g, b :LONGINT; f: BOOLEAN; BEGIN DSelectAll; While h=Nil DO BEGIN GetPt(x,y); h:=PickObject(x,y); END; hl := FInGroup(h); WHILE hl <> NIL DO BEGIN GetPenFore(hl,r,g,b); RGBToColorIndex(r,g,b,i); IF i=7 THEN h1:=hl; hl :=NextObj(hl); END; n:=GetVertNum(h1); GetPolyPt(h1,n,P1.x,P1.y); While h2=Nil DO BEGIN GetPt(x,y); h2:=PickObject(x,y); END; hl:= FInGroup(h2); GetPenFore(hl,r,g,b); RGBToColorIndex(r,g,b,i); WHILE i<>7 DO BEGIN hl :=NextObj(hl); GetPenFore(hl,r,g,b); RGBToColorIndex(r,g,b,i); END; GetPolyPt(hl,1,P2.x,P2.y); OpenPoly; BeginPoly; P3:=P1+( (P2-P1)/2); AddPoint(P1.x,P1.y); AddPoint(P3.x,P3.y); AddPoint(P2.x,P2.y); EndPoly; h3:= LnewObj; ColorIndexToRGB(6, r, g, b); SetPenFore(h3, r, g, b); HMoveForward (h,true); SetSelect(h); Hungroup(h); HMoveForward (h3,true); SetSelect(h3); HMoveForward (h2,true); SetSelect(h2); Hungroup(h2); Group; END; RUN (Join_Groups); Thanks in advance!!! Ivan Quote Link to comment
maarten. Posted July 20, 2011 Share Posted July 20, 2011 Are you sure your lines are the correct red? It has to be the 7th (i=7) colour of the "Classic VW colour palette" (wel, actually, the 8th one because white=0, black=1, ... yellow=5, green=6 and red=7) RGBToColorIndex(r,g,b,i); IF i=7 THEN h1:=hl; 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.