Hello again, I'm using the "red gate's. Net reflector" (
http://www.red-gate.com/products/reflector/) with the dll "aeccdbmgd.dll" and interesting things appeared:
(Namespace Autodesk.Civil.PipeNetwork.DatabaseServices, partdatafield, value, set_value method)
Public Sub set_Value(ByVal newValue As Object)
Dim type As CatDataType
If Me.IsReadOnly Then
Throw New InvalidOperationException("The property is for read only.")
End If
Checker.CheckArgNull(newValue)
If (Me.IsFromList AndAlso Not Me.ValueList.IsValidValue(newValue)) Then
Throw New ArgumentException("The input value is not in valid value list.")
End If
If (Me.IsFromRange AndAlso Not Me.ValueRange.IsValidValue(newValue)) Then
Throw New ArgumentException("The input value is not in valid value range.")
End If
Dim num8 As UInt32 = DirectCast((Me.m_dataField + 8), UInt32*)
If (num8 <> 0) Then
type = DirectCast((num8 + 40), CatDataType*)
Else
type = DirectCast(0, CatDataType)
End If
Select Case type
Case DirectCast(1, CatDataType)
Dim num4 As Double = 0
Try
num4 = CDbl(newValue)
Catch exception3 As InvalidCastException
Throw New ArgumentException("Requires a value of double.")
End Try
Dim units As SettingsUnits = <Module>.AeccNetworkUtils.getBuiltinLengthUnits(Me.m_dataField)
If (units <> DirectCast(0, SettingsUnits)) Then
Dim flag2 As DwgUnitAndConvertFlag
Dim servicesPtr As AcDbHostApplicationServices ModOpt(IsConst)* ModOpt(IsConst) ModOpt(IsConst) = <Module>.acdbHostApplicationServices
<Module>.AeccUnitBase.GetDwgUnitAndConvertFlag(AddressOf flag2, servicesPtr(8), 0)
Dim num3 As Double = 0
<Module>.AeccUnitBase.GetConversionFactor(DirectCast(AddressOf flag2, SettingsUnits ModOpt(IsConst)*), DirectCast((AddressOf flag2 + 4), FootToMeterConversion ModOpt(IsConst)*), units, AddressOf num3)
Dim num9 As Double = DirectCast(AddressOf <Module>.__imp_?gTol@AcGeContext@@2VAcGeTol@@A, Integer*)
If Not <Module>.AeccGeUtils.fuzzyEqual(num3, 0, num9) Then
Dim dataField As AeccDataField* ModOpt(IsConst) ModOpt(IsConst) = Me.m_dataField
dataField(&H10) = DirectCast((num3 * num4), AeccDataField* ModOpt(IsConst) ModOpt(IsConst))
Dim num2 As UInt32 = dataField(8)
If (num2 <> 0) Then
num2(40) = 1
End If
End If
End If
Exit Select
Case DirectCast(2, CatDataType)
Dim num6 As Integer = 0
Try
num6 = CInt(newValue)
Catch exception2 As InvalidCastException
Throw New ArgumentException("Requires a value of int.")
End Try
Dim fieldPtr3 As AeccDataField* ModOpt(IsConst) ModOpt(IsConst) = Me.m_dataField
fieldPtr3(&H18) = DirectCast(num6, AeccDataField* ModOpt(IsConst) ModOpt(IsConst))
Dim num5 As UInt32 = fieldPtr3(8)
If (num5 <> 0) Then
num5(40) = 2
End If
Exit Select
Case DirectCast(3, CatDataType)
Dim flag As Boolean = False
Try
flag = CBool(newValue)
Catch exception1 As InvalidCastException
Throw New ArgumentException("Requires a value of bool.")
End Try
Dim fieldPtr4 As AeccDataField* ModOpt(IsConst) ModOpt(IsConst) = Me.m_dataField
fieldPtr4(&H1C) = DirectCast(flag, AeccDataField* ModOpt(IsConst) ModOpt(IsConst))
Dim num7 As UInt32 = fieldPtr4(8)
If (num7 <> 0) Then
num7(40) = 3
End If
Exit Select
Case DirectCast(4, CatDataType)
Dim str2 As AecRmCString
Dim cliString As String = ""
Try
cliString = CStr(newValue)
Catch exception4 As InvalidCastException
Throw New ArgumentException("The inner type of object^ should be string.")
End Try
<Module>.Autodesk.Civil.ConvertCLIString(AddressOf str2, cliString)
Try
Dim fieldPtr As AeccDataField* ModOpt(IsConst) ModOpt(IsConst) = Me.m_dataField
<Module>.ATL.CStringT<wchar_t,StrTraitMFC_DLL<wchar_t,ATL::ChTraitsCRT<wchar_t> > >.=((fieldPtr + &H20), DirectCast(AddressOf str2, CStringT<wchar_t,StrTraitMFC_DLL<wchar_t,ATL::ChTraitsCRT<wchar_t> > > ModOpt(IsConst)* ModOpt(IsImplicitlyDereferenced)))
Dim num As UInt32 = fieldPtr(8)
If (num <> 0) Then
num(40) = 4
End If
Fault
<Module>.___CxxCallUnwindDtor(<Module>.AecRmCString.{dtor}, DirectCast(AddressOf str2, Void*))
End Try
<Module>.ATL.CStringT<wchar_t,StrTraitMFC_DLL<wchar_t,ATL::ChTraitsCRT<wchar_t> > >.{dtor}(DirectCast(AddressOf str2, CStringT<wchar_t,StrTraitMFC_DLL<wchar_t,ATL::ChTraitsCRT<wchar_t> > >* ModOpt(IsConst) ModOpt(IsConst)))
Exit Select
End Select
End Sub
note that if the value is of type double, it is modified only if the units of measurement do not match ... very strange ...
While well as for other types of data, is not working ...
If anyone here understand what is happening and to resolve the problem, I am willing to pay for the solution