VS:GetRField: Difference between revisions
m (1 revision) |
(warning about GetRecord(h, NumRecords(h))) |
||
Line 45: | Line 45: | ||
----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ||
<remark> | <remark> | ||
(Orso, 2015.02.24): | |||
Please note that since the introduction of ifc data, the usual praxis of fetching plug-in records using | |||
GetRecord(h, NumRecords(h)) | |||
can bring you perhaps unexpectedly the ifc record. Use [[VS:GetParametricRecord]] instead, introduced from VW 2011. | |||
(Others): | |||
Returns a string interpretation of the field from the specified record | Returns a string interpretation of the field from the specified record | ||
Note that when using this to access parameter fields in a PIO, you get the values of the instance of the plug-in, not the default values, as set in the plug-in editor. If you want the default values, you have to use the handle to the PIO record format. | [CLC 2001/11/12]: Note that when using this to access parameter fields in a PIO, you get the values of the instance of the plug-in, not the default values, as set in the plug-in editor. If you want the default values, you have to use the handle to the PIO record format. | ||
This returns values rounded to the nearest display accuracy, whereas pFieldName returns the actual number.</remark> | [CLC 2004/11/8]: This returns values rounded to the nearest display accuracy, whereas pFieldName returns the actual number. | ||
</remark> | |||
----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ||
Line 85: | Line 93: | ||
----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ||
<version> | <version> | ||
Availability: from | Availability: from VectorWorks 8.5 | ||
</version> | </version> |
Revision as of 14:25, 14 January 2016
.VectorScript|VectorScript ..VS:Function Reference|Function Reference ..VS:Function_Reference_Appendix|Appendix
Description
Returns string description of a value in the specified record field.
FUNCTION GetRField(
h :HANDLE;
record :STRING;
field :STRING) : DYNARRAY[] of CHAR;
def vs.GetRField(h, record, field): return DYNARRAY[] of CHAR
Parameters
h HANDLE Handle to object. record STRING Name of record format. field STRING Name of field to be queried.
Return Value
Returns the field value as a variable length string.
Remarks
(Orso, 2015.02.24):
Please note that since the introduction of ifc data, the usual praxis of fetching plug-in records using
GetRecord(h, NumRecords(h))
can bring you perhaps unexpectedly the ifc record. Use VS:GetParametricRecord instead, introduced from VW 2011.
(Others): Returns a string interpretation of the field from the specified record
[CLC 2001/11/12]: Note that when using this to access parameter fields in a PIO, you get the values of the instance of the plug-in, not the default values, as set in the plug-in editor. If you want the default values, you have to use the handle to the PIO record format.
[CLC 2004/11/8]: This returns values rounded to the nearest display accuracy, whereas pFieldName returns the actual number.
Example
VectorScript
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);
Python
Version
Availability: from VectorWorks 8.5