Accusoft NotateXpress 12
SetLayerFromVariant Method
See Also  Example  Send comments on this topic.
v
Variant byte array containing a single layer of annotation data.
Layer
The handle of a layer.
AccusoftNotateXpress12 ActiveX DLL > NotateXpress Object : SetLayerFromVariant Method

Glossary Item Box

Description

Sets the current annotation data for the specified layer into a variant byte array.

Syntax

Visual Basic
Public Sub SetLayerFromVariant( _
   ByRef v As Variant, _
   ByRef Layer As Long _
) 

Parameters

v
Variant byte array containing a single layer of annotation data.
Layer
The handle of a layer.

Remarks

The variant data will be in the format of the AnnotationType

The exception are that the NX_AnnotationType_I4W and NX_AnnotationType_TMS are not honored and will automatically try to use NX_AnnotationType_NXP 

Example

SetLayerFromVariant (Visual Basic)Copy Code
PublicSubLoadLayerFromDatabase(LayerNameAsString)
DimrsAsRecordset
DimtmpVAsVariant
DimqueryAsString
DimlayerHandleAsLong

'----------------------------
'weassumeherethatDBrepresentsanopendatabase
'withatablenamedLayer
'-----------------------------
query="Select*fromLayerswhereLayerName='"&LayerName&"'"

Setrs=DB.OpenRecordset(query,dbOpenSnapshot)
If(rsIsNothing)ThenExitSub
rs.MoveFirst

'----------------------------
'readtherecordintothevariant
'----------------------------
'NXPDataisthememo/binaryfield
'----------------------------
tmpV=rs!NXPData.GetChunk(0,rs!NXPData.FieldSize)

'----------------------------
'tellNotateXpresstoretrieveannotationsfrom
'thisvariant
'----------------------------
NotateXpress1.SetLayerFromVarianttmpV,layerHandle

IfNot(rsIsNothing)Then
rs.Close
Setrs=Nothing
EndIf

See Also

©2013. Accusoft Corporation. All Rights Reserved.