DelRecord Database / Record 
MiniCAD7.0

VectorScript Declaration:

PROCEDURE   DelRecord
(   h :HANDLE;
    name :STRING
) ;

Python:

def  vs.DelRecord(h, name):
   return None

Description:

Procedure DelRecord removes an attached record from the referenced object.

Parameters:

h Handle to object.
name Name of record to be removed.



  Field Database / Record 
MiniCAD

VectorScript Declaration:

PROCEDURE   Field
(   h :HANDLE;
    s1 :STRING;
    s2 :STRING;
    s3 :STRING
) ;

Python:

def  vs.Field(h, s1, s2, s3):
   return None

Description:

Obsolete.

See Also:

SetRField  



  GetFldName Database / Record 
MiniCAD

VectorScript Declaration:

FUNCTION   GetFldName
(   h :HANDLE;
    index :INTEGER
) :STRING ;

Python:

def  vs.GetFldName(h, index):
   return STRING

Description:

Returns the name of the specified field in the referenced record.

Parameters:

h Handle to record.
index Number of field whose name will be returned (in a range of 1-n).

Example:

FName:=GetFldName(HandleToRecord,1);



  GetFldType Database / Record 
MiniCAD

VectorScript Declaration:

FUNCTION   GetFldType
(   h :HANDLE;
    t :INTEGER
) :INTEGER ;

Python:

def  vs.GetFldType(h, t):
   return INTEGER

Description:

Returns a constant indicating the data type of a specified field in the referenced record.

Please refer to the VectorScript Appendix for specific field data types and formatting.

For Plug-in Object Parameter Records, the field types are documented in the VectorScript Appendix.

Parameters:

h Handle to record.
t Field index (range of 1 - n).

Example:

fieldType:=GetFldType(recordHandle,3);



  GetParametricRecord Database / Record 
Vectorworks 2011

VectorScript Declaration:

FUNCTION   GetParametricRecord
( h:HANDLE ) :HANDLE ;

Python:

def  vs.GetParametricRecord(h):
   return HANDLE

Description:

Returns the handle to the parametric record attached the referenced object.

Parametric record is a hidden record format containing the parameter values of the parametric object.
Only parametric objects have parametric records.

Parameters:

h Handle to a parametric object

Result:

Returns a handle to the record, or NIL if the record doesn't exist (e.g. not a parametric object passed)



  GetRecord Database / Record 
MiniCAD

VectorScript Declaration:

FUNCTION   GetRecord
(   h :HANDLE;
    cnt :INTEGER
) :HANDLE ;

Python:

def  vs.GetRecord(h, cnt):
   return HANDLE

Description:

Returns the handle to a specified record attached the referenced object.

Parameters:

h Handle to object.
cnt Index of attached record (in a range of 1 - n).

Example:

handleToRecord := GetRecord(handleToObject,3);



  GetRField Database / Record 
VectorWorks8.5

VectorScript Declaration:

FUNCTION   GetRField
(   h :HANDLE;
    record :STRING;
    field :STRING
) :DYNARRAY[] of CHAR ;

Python:

def  vs.GetRField(h, record, field):
   return DYNARRAY of CHAR

Description:

Returns string description of a value in the specified record field.

Parameters:

h Handle to object.
record Name of record format.
field Name of field to be queried.

Result:

Returns the field value as a variable length string.

Example:

PROCEDURE Example;

FUNCTION WriteFieldValues(h :HANDLE) :BOOLEAN;
VAR
   cnt     :INTEGER;
   recHand :HANDLE;
   recName :STRING;
   fldName :STRING;
BEGIN
   recName := GetName(GetRecord(h, NumRecords(h)));
   recHand := GetObject(recName);
   FOR cnt := 1 TO NumFields(recHand) DO BEGIN
      fldName := GetFldName(recHand, cnt);
      WriteLn(fldName, ': ', GetRField(h, recName, fldName));
   END;
END;

BEGIN
   ForEachObjectInLayer(WriteFieldValues, 2, 0, 4);
END;
RUN(Example);



  LinkText Database / Record 
MiniCAD

VectorScript Declaration:

PROCEDURE   LinkText
(   h :HANDLE;
    rec :STRING;
    fld :STRING
) ;

Python:

def  vs.LinkText(h, rec, fld):
   return None

Description:

Creates a linked text field in a newly created symbol. The specified text is linked to a record field, whose value is displayed by the text object.

LinkText must be called during symbol creation; the record to be associated with the linked text string must also exist at the time the link is created.

Parameters:

h Handle to text object that will be linked to record.
rec Name of record that will be linked to text string.
fld Name of field that will be linked to text string.

Example:

BeginSym('Symbol #2');
  Oval(-3/4",1/2",3/4",-1/2");
  TextFont(3);
  TextSize(12.00037);
  TextJust(1);
  TextOrigin(0.8611111",0.5138889");
  BeginText;
   'Field 9 String'
  EndText;
  LinkText(LNewObj,'Sample Format','Field 1');
EndSym;
Record(LNewObj,'Sample Format');

See Also:

BeginSym   EndSym  



  NewField Database / Record 
MiniCAD

VectorScript Declaration:

PROCEDURE   NewField
(   recName :STRING;
    fieldName :STRING;
    fieldValue :DYNARRAY[] of CHAR;
    fType :INTEGER;
    fFlag :INTEGER
) ;

Python:

def  vs.NewField(recName, fieldName, fieldValue, fType, fFlag):
   return None

Description:

Creates a new field in a specified record format. If the record does not exist, a new one is created using the specified record name.

Please refer to the VectorScript Appendix for specific field data types and formatting.




Parameters:

recName Name of record to which field will be added.
fieldName Name of new field.
fieldValue Default value for new field.
fType Data type of new field.
fFlag Display style of field.

Example:

NewField('Part Info','Serial No.','A-0000',4,0);



  NumFields Database / Record 
MiniCAD

VectorScript Declaration:

FUNCTION   NumFields
( h:HANDLE ) :INTEGER ;

Python:

def  vs.NumFields(h):
   return INTEGER

Description:

Returns the number of fields in the referenced record.

Parameters:

h Handle to record.

Example:

totalFields:=NumFields(HandleToRecord);



  NumRecords Database / Record 
MiniCAD

VectorScript Declaration:

FUNCTION   NumRecords
( h:HANDLE ) :INTEGER ;

Python:

def  vs.NumRecords(h):
   return INTEGER

Description:

Returns the number of records attached to the referenced object.

Parameters:

h Handle to object.

Example:

numAttached:=NumRecords(HandleToObject);



  Record Database / Record 
MiniCAD

VectorScript Declaration:

PROCEDURE   Record
(   h :HANDLE;
    s :STRING
) ;

Python:

def  vs.Record(h, s):
   return None

Description:

Replaces an existing record with a new version of the same record. Parameter s specifies the record to be updated.

Parameters:

h Handle to object.
s Name of record to be updated.

Example:

Record(handleToObj,'Vendor Information');



  SetRecord Database / Record 
MiniCAD

VectorScript Declaration:

PROCEDURE   SetRecord
(   h :HANDLE;
    record :STRING
) ;

Python:

def  vs.SetRecord(h, record):
   return None

Description:

Assigns an instance of an existing record format to the referenced object .

Parameters:

h Handle to object.
record Name of record to assign to object.

Example:

SetRecord(HandleToObject,'Part Info');



  SetRField Database / Record 
MiniCAD

VectorScript Declaration:

PROCEDURE   SetRField
(   h :HANDLE;
    record :STRING;
    field :STRING;
    value :DYNARRAY[] of CHAR
) ;

Python:

def  vs.SetRField(h, record, field, value):
   return None

Description:

Assigns a new value to an existing field of a record attached to the referenced object.

Parameters:

h Handle to a object with an attached record.
record Name of record to be updated.
field Name of field to be updated.
value New value for field.

Example:

SetRField(HandleToObject,'Part Info','Serial No.','P-4322');