Python3 can't connect Tekla in Rhino8

Hi,
I get this error which I still cannot solve, I try with old ghpython in Rhino7 and it’s working good, but python3 grasshopper in Rhino8 seem can’t link to tekla

import clr
clr.AddReference(r"C:\TeklaStructures\2022.0\bin\Tekla.Structures.dll")
clr.AddReference(r"C:\TeklaStructures\2022.0\bin\Tekla.Structures.Plugins.dll")
clr.AddReference(r"C:\TeklaStructures\2022.0\bin\Tekla.Structures.Model.dll")
import Tekla.Structures.Model as md
model = md.Model()
a = model.GetInfo().NorthDirection

System.TypeInitializationException: The type initializer for ‘Tekla.Structures.ModelInternal.DelegateProxy’ threw an exception.

Hi, could have something to do with .NET Core vs .NET framework

Although not sure how it comes about in this context.

Cheers,

Sebastian

1 Like

Hi,
I’m just new in python 3 , I tried to fix it, but couldn’t. Can’t find choose unit .NET Framework or .Net Core
Any example code for this ? or C# in grasshopper Rhino8
Thank for your time.

@Shank let’s figure out if this is an internal problem in Tekla dll first. Are you using these dlls in a dotnet plugin? Let’s run this C# script to see if they work:

// r "C:\TeklaStructures\2022.0\bin\Tekla.Structures.dll"
// r "C:\TeklaStructures\2022.0\bin\Tekla.Structures.Plugins.dll"
// r "C:\TeklaStructures\2022.0\bin\Tekla.Structures.Model.dll"

using System;
using Tekla.Structures;

var model = new Model();
Console.WriteLine($"{model.GetInfo().NorthDirection}");