VS:GetTextureRefN

From Vectorworks Developer
Revision as of 14:40, 30 December 2017 by CBM-c- (talk | contribs) (add comment, example)
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

.VectorScript|VectorScript ..VS:Function Reference|Function Reference ..VS:Function_Reference_Appendix|Appendix

Description

Returns the texture reference for a specified object.

FUNCTION GetTextureRefN(
obj :HANDLE;
texPartID :LONGINT;
texLayerID :LONGINT;
resolveByClass :BOOLEAN) : LongInt;
def vs.GetTextureRefN(obj, texPartID, texLayerID, resolveByClass):
    return LongInt

Parameters

obj HANDLE
texPartID LONGINT
texLayerID LONGINT Texture layer ID, 0 for base, >0 for decals
resolveByClass BOOLEAN

Remarks

(Orso, 2017 Dec. 30): This was always a cryptical call, below an example from my own notes:

{ set texLayerID to 0, if you don't have decals you want to access }

GetTextureRefN(obj, 3, 0, FALSE); 
{ returns info on the overall part (3)
* texture index if the part is "texture"  
* 0 if the part is "None"   
* -1 if the part is "Class Texture"  
}

GetTextureRefN(obj, 3, 0, TRUE); 
{ returns info on the overall part (3)
* texture index if the part is "texture"  
* 0 if the part is "None"   
* index of the class texture if the part is "Class Texture"  
}

Version

Availability: from Vectorworks 2010