moethu / SketchUpNET

SketchUp C# API - A C++/CLI API Wrapper for the Trimble(R) SketchUp(R) C API
MIT License
108 stars 34 forks source link

SketchUpNET could not load file or assembly #25

Closed MxMostafa closed 4 years ago

MxMostafa commented 4 years ago

my project c# console i add the library on project and build success but when run the project get the error could not load file or assembly..... i change build mode x86 x64 any cpu downloaded files SketchUpNET build 180818.zip

moethu commented 4 years ago

Hi @MxMostafa, some questions regarding your build:

moethu commented 4 years ago

You can also try the latest version that I just built

MxMostafa commented 4 years ago

Hi @moethu I Send Email for you to ‫maximilianoe*thumfart[at]gmail I Use 180818 version i Download SketchUpNET-master and After Extract from SketchUpNET-master\SketchUp\API path add the SketchUpAPI.dll to reference but get error 'SketchUpAPI.dll could not be added. please make sure that the file is accessible. and that is a valid assembly or COM component ' from path 'SketchUpNET-master\SketchUp' I Can Add 'SketchUpNET.dll' to reference and build but when run get error 'can not load file or assembly SketchUpNET.dll or one of its dependencies.' my projcet console appplication .net 4.5.2

moethu commented 4 years ago

Hi @MxMostafa, so you were able to build SketchUpNET successfully right? I would recommend to follow the example projects which are already in the solution. Like SketchUpDynamo. It shows how to setup a project referring to all necessary libraries. Please make sure that:

You can also check for the missing dependency using a dependency walker but to me it smells like a targeting wrong arch issue.

moethu commented 4 years ago

@MxMostafa I added a sample console app for you here: https://github.com/moethu/SketchUpNET/tree/master/SketchUpNETConsole

MxMostafa commented 4 years ago

thank you so much in my language Persian : "خیلی مردی" Which English is ' Very manly ' "خیلی مردی" : A very thankful term

but i have a question can i create plugin for sketchup with c# and add icon to sketchup menu or must for create plugin use ruby? i will add button to sketchup menu and when click get current document and get all material info and save to database now i can use your library to get file information and can save data to database just i will add button to sketchup menu And finally, thank you again

‫‪moethu‬‏ ‪notifications@github.com‬‏ در تاریخ چهارشنبه ۲۷ مهٔ ۲۰۲۰ ساعت ۱۰:۳۳ نوشت:‬

@MxMostafa https://github.com/MxMostafa I added a sample console app for you here: https://github.com/moethu/SketchUpNET/tree/master/SketchUpNETConsole

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/moethu/SketchUpNET/issues/25#issuecomment-634447598, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGTZPWU6KETS47AZEVGRO63RTSULNANCNFSM4NE7JTOA .

moethu commented 4 years ago

@MxMostafa I'm glad I was able to help you. If you want to add a button you'll have to go through ruby. But what you can do is the following thing I did in this project: https://github.com/grevit-dev/Grevit/blob/master/Grevit.SketchUp/grevit_send_menu.rb Add a small ruby script adding a button to SketchUp which then calls a command line application. This way you can develop your application fully in C#.NET but call it from a button in SketchUp. What I'm doing is simply saving the skp to a temp file and then reading it using the commandline app.