MarckyMON
Computer
- Nov 30, 2010
- 93
Hi everyone,
I am currently developing a function which counts the number of all round ID symbols containing specific text. Since the NX4 NX/Open VB.NET API does not contain an IDSymbol object, I am using the UG/Open wrapper functions instead:
When running the program, it terminates with a System.NullReferenceException when trying to call AskIdSymbolInfo. Here is the snippet from the log file:
System.NullReferenceException: Object reference not set to an instance of an object.
at NXOpen.UF.UFDrf.AskIdSymbolInfo(Tag id_symbol_tag, IdSymbolType& id_symbol_type, Double[] id_symbol_origin, IdSymbolInfo[]& id_symbol_info)
at TDF_MIKRON_change_table.ChangeTable.CountIDSymbols(Part workPart, String idText)
at TDF_MIKRON_change_table.EntryPoint.Main()
*** EXCEPTION: Error code 67 in line 996 of O:\ugnx404\ip2\src\syss\no\ind\lmldr.c at Tue Dec 07 21:34:33 2010 W. Europe Standard Time
+++ Object reference not set to an instance of an object.
I'm not sure where the problem is, but my hunch is it has something to do with the variable declaration:
I'm really at a loss here and any help is much appreciated. Thanks!
I am currently developing a function which counts the number of all round ID symbols containing specific text. Since the NX4 NX/Open VB.NET API does not contain an IDSymbol object, I am using the UG/Open wrapper functions instead:
Code:
Dim idSymbolType As UFDrf.IdSymbolType
Dim idSymbolOrigin() As Double = {0.0, 0.0, 0.0}
Dim idSymbolInfo() As UFDrf.IdSymbolInfo
ufSession.Drf.AskIdSymbolInfo(idSymbolTag, idSymbolType, idSymbolOrigin, idSymbolInfo)
When running the program, it terminates with a System.NullReferenceException when trying to call AskIdSymbolInfo. Here is the snippet from the log file:
System.NullReferenceException: Object reference not set to an instance of an object.
at NXOpen.UF.UFDrf.AskIdSymbolInfo(Tag id_symbol_tag, IdSymbolType& id_symbol_type, Double[] id_symbol_origin, IdSymbolInfo[]& id_symbol_info)
at TDF_MIKRON_change_table.ChangeTable.CountIDSymbols(Part workPart, String idText)
at TDF_MIKRON_change_table.EntryPoint.Main()
*** EXCEPTION: Error code 67 in line 996 of O:\ugnx404\ip2\src\syss\no\ind\lmldr.c at Tue Dec 07 21:34:33 2010 W. Europe Standard Time
+++ Object reference not set to an instance of an object.
I'm not sure where the problem is, but my hunch is it has something to do with the variable declaration:
Code:
Dim idSymbolInfo() As UFDrf.IdSymbolInfo
I'm really at a loss here and any help is much appreciated. Thanks!