KeithSloan / ImportNURBS

Add Import of 3DM files to FreeCAD
Other
11 stars 5 forks source link

Add to FreeCAD-addons? #3

Closed yorikvanhavre closed 4 years ago

yorikvanhavre commented 4 years ago

Hi Keith, I think this would be great to add to the addons repo... Would you agree to turn this into a valid FreeCAD module? I think you'd only need to move the contents of freecad/importNURBS into the root folder, and the InitGui.py could be renamed Init.py so it works also in no-GUI mode... Cheers Yorik

KeithSloan commented 4 years ago

Hi York

Well the structure is the same as GDML so should already be installable as is.

Just needs details icon etc adding to the FreeCAD website. I have not done so as it still needs a lot of development. Maybe add it with some under construction info.

Keith

KeithSloan commented 4 years ago

Also not sure about required python module opennurbs.

yorikvanhavre commented 4 years ago

It is installable, but the repo will simply be unpacked as is in the FreeCAD Mods folder, so it won't work, unless you add an Init.py file to the root, I'll make you a PR with that. About the 3dm module, at the moment I think the best way is simply to warn the user if the module is not present... I'll include that in my PR as well.

KeithSloan commented 4 years ago

Don't understand GDML works without Init.py. I cloned it to /Users/keithsloan/Library/Preferences/FreeCAD/Mod Started FreeCAD ( which is .18 on Mac) Allowed me to select a 3DM file for opening on which FreeCAD just exited. Mmm

KeithSloan commented 4 years ago

Was working on my Ubuntu, but machine is away because of hardware problem.

KeithSloan commented 4 years ago

Seems to be a problem on Mac with

try: import rhino3dm

except: FreeCAD.Console.PrintError("You must install rhino3dm first !") exit()

Just exits FreeCAD

import rhino3dm

Gives error, but not nice error

yorikvanhavre commented 4 years ago

Oh you're right, it works without Init.py. Never really got used to looo's new structure... About the mac error, I would simply change the exit() statement with return I think

KeithSloan commented 4 years ago

"Never really got used to looo's new structure..."

Your speaking to the wrong guy - Tell me about it.

Took me ages to get things working the first time

KeithSloan commented 4 years ago

changing exit() to return - Gives

Traceback (most recent call last): File "", line 1, in <class 'SyntaxError'>: 'return' outside function (import3DM.py, line 11)

yorikvanhavre commented 4 years ago

Okay I merged your FreeCAD PR and this repo is added to the FreeCAD addons!