Returns whether a layer is workgroup referenced, and if so, the path to the source document is returned.
FUNCTION IsLayerReferenced(
layer : HANDLE;
VAR pathname : STRING): BOOLEAN;def vs.IsLayerReferenced(layer):
return (BOOLEAN, pathname)| Name | Type | Description |
|---|---|---|
| layer | HANDLE | Handle to the layer |
| pathname | STRING | On return, a string containing the path to the source document |
This returns FALSE on broken references to layers belonging to files residing on external disks. It is not correct, even if the reference is broken, the layer is nevertheless referenced, so the routine should return TRUE. (VW 13-83388).
Use the pref object boo 700, instead, it is more secure:
IsReferenced := GetObjectVariableBoolean(handleToResourceDefinition, 700); { locked/referenced status }BEGIN
IF (NOT IsLayerReferenced(layerHdl, LayerRefPath)) & (GetObjectVariableInt(layerHdl,154) = 1) THEN
BEGIN
layerNm := GetLName(layerHdl);
AddChoice(LayerDlgID, 12, layerNm, index);
index := index +1;
END;import vs
# Returns whether a layer is workgroup referenced, and if so, the path to the
# source document is returned.
layer = vs.ActLayer() # handle to the active design layer
ok, pathname = vs.IsLayerReferenced(layer)
vs.Message('IsLayerReferenced returned: ' + str((ok, pathname)))Availability: from VectorWorks10.0