jmplonka / InventorLoader

Workbench for FreeCAD to loads or import Autodesk (R) Inventor (R) files.
GNU General Public License v2.0
114 stars 17 forks source link

Guide how to setup MS Visual Studio for debugging add-on would be very helpfull #20

Closed nicedayvl closed 5 years ago

nicedayvl commented 5 years ago

hi Jens, could you share please your knowledge how to configure MS Visual Studio, say 2015 version to run and debug your addon inside FC

is that possible? thanks in advance

nicedayvl commented 5 years ago

step by step guide would be very helpfull btw

jmplonka commented 5 years ago

I'm working with to development version to save time:

After synchronizing the FreeCAD version with the command line version I do normally a push to git if everything is working as expected.

  1. in VS select new project -> Intalled/Templates/Python: "Python Application" a) define a name (e.g.: "InventorLoader_cmd") b) set the location (e.g.: "D:\Projects\Python") - the subfolder will be created for your project c) uncheck "Create directory for solution"
  2. Remove the default python file because be we don't need it.
  3. Drag'n drop all required files into the view "Solution Explorer", alternatively you can add already existing items by pressing Shft+Alt+A
  4. Define _main.py as default startup script (context menu: "Set as Startup file")
  5. Add the missing wrapper files after removing the .txt extension:
  6. By default VS sets up the Project with the global defined python version. Here you can specify your own / different installation by adding a new python environment (e.g.: Python 3.7) via it's context menu: Add/remove python environments
nicedayvl commented 5 years ago

thanks Jen, will try this configuration

nicedayvl commented 5 years ago

hi Jens, I did al step by step and getting exception in importerUtil.py

from PySide.QtCore import from PySide.QtGui import

any ideas?

nicedayvl commented 5 years ago

exception says DLL load fialed

jmplonka commented 5 years ago

It seems, you have already an QT installation for python. Unfortunately it is not compatible with your python version (e.g. 32Bit vs 64bit) linked in the project. Maybe you can try to install a new Python version (e.g. 3.7) somewhere and reference it in your InventorLoader project (by adding this python environment). But don't forget to install the required libraries (open the cmd.exe and set PATH=somewhere\bin and navigate to the libs folder and run python installLibs.py!

nicedayvl commented 5 years ago

I have no QT installation, I have no QT at all besides QT dlls in bin folder of FC

nicedayvl commented 5 years ago

seems I solved problem with QT, now other exception No module named BOPTools.GeneralFuseResult in Acis.py

ImportError was unhandled by user code Message: No module named BOPTools.GeneralFuseResult

nicedayvl commented 5 years ago

btw I set directory C:\Program Files\FreeCAD 0.17\bin\ very first in the system wide PATH

jmplonka commented 5 years ago

Can you please try to extract into project folder: BOPTools.zip

nicedayvl commented 5 years ago

thanks! but I copied files into project dir and added to workspace and still get same exception like python don't see them

nicedayvl commented 5 years ago

Running D:\Projects\Python\InventorLoader_cmd_main.py Traceback (most recent call last): File "D:\Projects\Python\InventorLoader_cmd_main.py", line 4, in import importerIL, importerSAT, importerUtils File ".\importerIL.py", line 8, in import os, sys, FreeCAD, importerSAT, Import_IPT File ".\importerSAT.py", line 8, in import tokenize, sys, FreeCAD, Part, re, Acis, traceback, datetime, ImportGui File ".\Acis.py", line 12, in from BOPTools.GeneralFuseResult import GeneralFuseResult ImportError: No module named BOPTools.GeneralFuseResult

nicedayvl commented 5 years ago

would you like to try teamviewer session please do you have skype btw?

jmplonka commented 5 years ago

It's a little bit tricky to analyse the issue. your project folder should now look like: ` ... InventorLoader_cmd\Acis.py

BOPTools__init__.py

BOPTools\GeneralFuseResult.py

BOPTools\Utils.py

... ` Your project should in VS also look like: grafik

nicedayvl commented 5 years ago

now missing ImportGui

nicedayvl commented 5 years ago

and I haven't folder PySide and its contents btw

jmplonka commented 5 years ago

PySide.zip Sorry for all these inconveniences...

nicedayvl commented 5 years ago

ImportGui please :)

jmplonka commented 5 years ago

voila: ImportGui.zip

jmplonka commented 5 years ago

I think it would have been easier if I had a eMail-address of you...

nicedayvl commented 5 years ago

I wrote you mail to your gmail address from metadata.txt

nicedayvl commented 5 years ago

image

jmplonka commented 5 years ago

The reason is, that in your %APPDATA%\FreeCAD\user.cfg a value is missing: <FCBool Name="checkLogging" Value="0"/> Please replace line 62 in FreeCAD.py with: e = xml.etree.ElementTree.SubElement(self.prm, 'FCBool')

nicedayvl commented 5 years ago

thanks Jens! now debugging seems working as needed