Jump to content
Developer Wiki and Function Reference Links ×

Script made on VW 11.5 doesn't work on VW2008


Recommended Posts

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

Link to comment

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...