Hello, first of all excuse me for my english...
I wrote a "point object" with vectorscript. I cannot understand how to define fields in a record ad the same time when the object is created.
In a document I create a record (DIMENSIONS) with the following fields:
DIAMETER
LENGHT
I would like put automatically the Parametric Data in the fields so in the "point object" script i use this functions:
SetRecord(handle,recname);
SetRField(handle,recname,field,string);
I cannot understand which kind of handle i have to use to fill-in the field at same time when the object is placed. I tried in many different ways but nothing to do! It doesn't works... (
Someone can help me? Thanks a lot
This is the complete script:
---------------------------------
Procedure curva;
VAR
sin45,cos45,sin30,cos30,x,y,x1,y1,x2,y2,x3,y3:real;
recname,valorediam:STRING;
BEGIN
SetRecord(FActLayer,recname);
SetRField(FActLayer,recname,'tipo','curva');
SetRField(FActLayer,recname,'diametro',valorediam);
recname:='dimensioni';
valorediam:=num2str(3,PD);
sin45:=sin(0.785398163);
cos45:=cos(0.785398163);
sin30:=sin(1.047197551);
cos30:=cos(1.047197551);
x:=PD-(cos45*0.5*PD);
y:=-PD+(sin45*0.5*PD);
x1:=PD-(cos45*1.5*PD);
y1:=-PD+(sin45*1.5*PD);
x2:=PD-(cos30*0.5*PD);
y2:=-PD+(sin30*0.5*PD);
x3:=PD-(cos30*1.5*PD);
y3:=-PD+(sin30*1.5*PD);
if (Pangolo='90') then
begin
arc(-PD/2,PD/2,5/2*PD,-5/2*PD,#90?,#90?);
arc(PD/2,-PD/2,3/2*PD,-3/2*PD,#90?,#90?);
moveto(-PD/2,-PD);
lineto(PD/2,-PD);
moveto(PD,PD/2);
lineto(PD,-PD/2);
locus(0,0);
end
else
if (pangolo='45') then
begin
arc(-PD/2,PD/2,5/2*PD,-5/2*PD,#90?,#45?);
arc(PD/2,-PD/2,3/2*PD,-3/2*PD,#90?,#45?);
moveto(x,y);
lineto(x1,y1);
moveto(PD,PD/2);
lineto(PD,-PD/2);
locus(0,0);
end
else
if (pangolo='30') then
begin
arc(-PD/2,PD/2,5/2*PD,-5/2*PD,#90?,#30?);
arc(PD/2,-PD/2,3/2*PD,-3/2*PD,#90?,#30?);
moveto(x2,y2);
lineto(x3,y3);
moveto(PD,PD/2);
lineto(PD,-PD/2);
locus(0,0);
end;
end;
run(curva);