lv net dll py
v0.1
เข้าถึง. NET DLL (พร้อมคลาส LabView) ใน Python
ca_obj = ClientApp1Lib . ClientApp1Lib . ClientApp1 ()
# alas, it calls "new" which triggers file search popup window (known LabVIEW class issue) # so start with a non initialized obj ref and use Create.vi to initialize the LabVIEW class ref
ca_obj = AssemblyLib . ClientApp1Lib . ClientApp1
ca_Type = clr . GetClrType ( AssemblyLib . ClientApp1Lib . ClientApp1 ) # get type
print ( ca_Type . FullName , " t " , ca_Type )
# GetUninitializedObject to avoid constructor and 'new' issue
ca_obj = System . Runtime . Serialization . FormatterServices . GetUninitializedObject ( ca_Type ) print ( ca_obj . IsValid (), " t " , ca_obj ) # False
ca_obj = AssemblyLib . ClientApp1Lib . ClientApp1 . Create ( ca_obj , ca_obj )
print ( ca_obj . IsValid (), " t " , ca_obj ) # Trueหมายเหตุ: สำหรับข้อมูลเพิ่มเติมเกี่ยวกับปัญหาโหนดคอนสตรัคเตอร์ใน VS ดูทริกเกอร์ใหม่ 'ทริกเกอร์ทริกเกอร์ไปยังไฟล์ lvclass บนดิสก์
clientapp1.dll (ตัวอย่าง interopassembly ของฉัน)
consoleapp_ra_e0/program.cs (ตัวอย่างคอนโซล c# ของฉัน)
วิธีเรียกไลบรารีแบบไดนามิก (Pythonnet Wiki)
Python สำหรับ NET วิธีการสร้างอินสแตนซ์ของคลาส CSHARP อย่างชัดเจน (StackOverFlow QA)