AccusoftNotateXpress13 ActiveX DLL > NotateXpress Object : SetLayerFromVariant Method |
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
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