Q: How to avoid the compilation error with inconsistent accessibility of class and methods? I reflect on an Autodesk assembly and found the following:

Note that for the PressurePipeNetwork class, it is public, and there is a method AddLinePipe which is also a public. However, one of the parameters for AddLinePipe, PressurePartSize is internal.

Usually we will not be able to compile with code like this ( and we will get "Inconsistent Accessibility" sort of compilation error) in .Net. But somehow this assembly got away with it.
And I check already, there is only one PressurePartSize in the assembly.
I'm not too sure when someone said that it cannot be done. Autodesk already did it; I got the assembly!
Not only that, one can somehow use the library in C#, but with the error message

Autodesk.Civil.DatabaseServices.Styles.PressurePartSize is showing
  error that in accessable due to protection level.

How to do it? I am willing to use any language to achieve this, not just C#. or .Net

A: This cannot be done in C#. The .NET virtual machine is more lenient than C#, though. There are many features that C# does not expose.
At the IL level you can call non-public methods just fine. You also can do that using runtime code generation using reflection emit. This is very useful for creating fast serializers.
The JIT also is able to compile unverifiable and even incorrect IL. The result is not fully defined.
How was this assembly created? My first thought was that this is the result of an IL linker tool. .NET assemblies can be post-processed to merge or optimize them. This also could be the result of an obfuscation tool (especially the method that cannot be decompiled).
Looks like the tool has a bug because it surely is not intentional to create a public method that is not normally callable.
If you want to experiment with this you can decompile any assembly to IL, edit it and compile it. IL is made to round-trip anything I believe.

A: Just a suggestion. There could be two PressurePartSize classes: a public one and an internal one. It's not clear from the pictures.
Something like this:
namespace SampleLib
{
    using SampleLib.Internal;
    //using SampleLib.Public;

    public class PublicClass
    {
        public unsafe void PublicMethod(InternalClass internalClass) { }
    }
}

namespace SampleLib.Internal
{
    internal sealed class InternalClass { }
}

namespace SampleLib.Public
{
    public sealed class InternalClass { }
}


Error CS0051  Inconsistent accessibility: parameter type 'InternalClass' is less accessible than method 'PublicClass.PublicMethod(InternalClass)'

But
namespace SampleLib
{
    //using SampleLib.Internal;
    using SampleLib.Public;

    public class PublicClass
    {
        public unsafe void PublicMethod(InternalClass internalClass) { }
    }
}

namespace SampleLib.Internal
{
    internal sealed class InternalClass { }
}

namespace SampleLib.Public
{
    public sealed class InternalClass { }
}

Is OK.
Update
There is only one PressurePartSize, see the updated question.
Than it seems they had Autodesk.Civil.DatabaseServices.Styles.PressurePartSize public at first. Then they created a library with public unsafe ObjectId AddLinePipe(LineSegment3d line, PressurePartSize partSize) and built it. Then they changed Autodesk.Civil.DatabaseServices.Styles.PressurePartSize to internal, but did not rebuilt the calling library. But JIT compiler checks accesability at runtime. That's the reason of the exception you mentioned.
