Plug-in for AUTODESK Inventor files

Need help, or want to share a macro? Post here!
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
User avatar
Roy_043
Veteran
Posts: 8539
Joined: Thu Dec 27, 2018 12:28 pm

Re: Plug-in for AUTODESK Inventor files

Post by Roy_043 »

Things seem to work fine in V0.19 now. But when I start V0.18 there is an error:
During initialization the error No module named olefile occurred in C:\Users\<username>\AppData\Roaming\FreeCAD\Mod\InventorLoader\InitGui.py
Please look into the log file for further information


I have tried to follow this procedure again (using the V0.18 bin path) and have also tried reloading the addon via the Addon manager. Both without success.
User avatar
Roy_043
Veteran
Posts: 8539
Joined: Thu Dec 27, 2018 12:28 pm

Re: Plug-in for AUTODESK Inventor files

Post by Roy_043 »

Another file that causes an error:
Missing class implementation for 'material-adesk-attrib' - using base class 'adesk-attrib'!
Missing class implementation for 'material-adesk-attrib' - using base class 'adesk-attrib'!
Missing class implementation for 'material-adesk-attrib' - using base class 'adesk-attrib'!
Missing class implementation for 'material-adesk-attrib' - using base class 'adesk-attrib'!
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\<username>\AppData\Roaming\FreeCAD\Mod\InventorLoader\importerIL.py", line 108, in insert
open(filename, skip, only, root)
File "C:\Users\<username>\AppData\Roaming\FreeCAD\Mod\InventorLoader\importerIL.py", line 124, in open
reader.create3dModel(None , doc)
File "C:\Users\<username>\AppData\Roaming\FreeCAD\Mod\InventorLoader\importerDXF.py", line 45, in create3dModel
importModel(group)
File "C:\Users\<username>\AppData\Roaming\FreeCAD\Mod\InventorLoader\importerSAT.py", line 146, in importModel
bodies = _resolveNodes(acis)
File "C:\Users\<username>\AppData\Roaming\FreeCAD\Mod\InventorLoader\importerSAT.py", line 133, in _resolveNodes
node = createNode(entity)
File "C:\Users\<username>\AppData\Roaming\FreeCAD\Mod\InventorLoader\Acis.py", line 289, in createNode
node.set(entity)
File "C:\Users\<username>\AppData\Roaming\FreeCAD\Mod\InventorLoader\Acis.py", line 3802, in set
self.alhpa = ((int(rgba) >> 24) & 0xFF) / 255.0
<class 'ValueError'>: invalid literal for int() with base 10: '#'


Version:

Code: Select all

OS: Windows 8.1 (6.3)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.21097 (Git)
Build type: Release
Branch: master
Hash: a5ab09aa0941cc945e59848897b160f8cbfc0831
Python version: 3.6.8
Qt version: 5.12.1
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: Dutch/Netherlands (nl_NL)
Attachments
Window_test.dxf
(159.76 KiB) Downloaded 74 times
User avatar
johnwang
Veteran
Posts: 1382
Joined: Sun Jan 27, 2019 12:41 am

Re: Plug-in for AUTODESK Inventor files

Post by johnwang »

Roy_043 wrote: Tue May 19, 2020 6:06 pm Things seem to work fine in V0.19 now. But when I start V0.18 there is an error:
During initialization the error No module named olefile occurred in C:\Users\<username>\AppData\Roaming\FreeCAD\Mod\InventorLoader\InitGui.py
Please look into the log file for further information


Both without success.
When you have two version of FCs, the other will has this problem. Because you didn't install the wb on it.
The installed information is stored in a public space on c drive for the user. When fc starts, it reads this information. This information direct fc to look for olefile in a fc folder. But the one without the wb doesn't have this file.
This is common problem when you install wb through add on manager. I don't know if add on manager has an option to install all wb information inside fc only. And you could try install wb manually, Copy everything under yourfc/mod/yourwb. In this case, maybe move everything under C:\Users\<username>\AppData\Roaming\FreeCAD\Mod\InventorLoader\ to you fc folder. In this way, your 0.19 still fine with the wb. Your 0.18 doesn't give an error msg and doesn't have the wb.
hfc series CAE workbenches for FreeCAD (hfcNastran95, hfcMystran, hfcFrame3DD, hfcSU2 and more)
jmplonka
Posts: 138
Joined: Tue Dec 20, 2016 7:47 am
Location: Vaihingen (Enz), Germany

Re: Plug-in for AUTODESK Inventor files

Post by jmplonka »

Roy_043 wrote: Tue May 19, 2020 6:23 pm Another file that causes an error:

Missing class implementation for 'material-adesk-attrib' - using base class 'adesk-attrib'!

Traceback (most recent call last):
File "C:\Users\<username>\AppData\Roaming\FreeCAD\Mod\InventorLoader\Acis.py", line 3802, in set
<class 'ValueError'>: invalid literal for int() with base 10: '#'
Both errors should be fixed now.
User avatar
Roy_043
Veteran
Posts: 8539
Joined: Thu Dec 27, 2018 12:28 pm

Re: Plug-in for AUTODESK Inventor files

Post by Roy_043 »

jmplonka wrote: Wed May 20, 2020 6:12 am Both errors should be fixed now.
Thanks.

There are other issues with the Window_test.dxf file though.
In the file there are 7 solids.

Two are 1000x1000x1000 cubes. These are helper solids that BricsCAD uses for parametrics and to subtract holes from walls.
If the 'convert to STEP' option is selected the position of one of the cubes is faulty.

The other 5 solids form the window. In the top view the window outline should match the subtractor cubes: the window should be 1000x1000. But somehow the imported window measures 133.33x133.33. A 1/7.5 factor smaller than it should be.

Another thing that is peculiar: The DXF 3D import function always creates a new file. Even if you use the Std_Import command. That is not consistent with how other importers work.
User avatar
Roy_043
Veteran
Posts: 8539
Joined: Thu Dec 27, 2018 12:28 pm

Re: Plug-in for AUTODESK Inventor files

Post by Roy_043 »

Regarding the installation issues: wouldn't it make more sense to install the dependencies in the
C:\Users\<username>\AppData\Roaming\FreeCAD\Mod\InventorLoader\
folder?
kisolre
Veteran
Posts: 4166
Joined: Wed Nov 21, 2018 1:13 pm

Re: Plug-in for AUTODESK Inventor files

Post by kisolre »

Looks like on first run it will install missing dependencies now. Nice :)
User avatar
Roy_043
Veteran
Posts: 8539
Joined: Thu Dec 27, 2018 12:28 pm

Re: Plug-in for AUTODESK Inventor files

Post by Roy_043 »

kisolre wrote: Wed May 20, 2020 11:03 am Looks like on first run it will install missing dependencies now. Nice :)
There is a downside to this approach. If you start a different FreeCAD version it will try to install the dependencies (without success) every time you start the application.

In my case I first installed the add-on in V0.19. I have tried to start V0.18 as administrator and have also tried running that version from a folder other than 'Program Files'. The only solution that I could find is to copy the dependencies from the FreeCAD V0.19 program folder:

Code: Select all

<FreeCAD program folder>\bin\Lib\site-packages\easy-install.pth
<FreeCAD program folder>\bin\Lib\site-packages\olefile-0.45.1-py3.6.egg
<FreeCAD program folder>\bin\Lib\site-packages\xlrd-1.1.0-py3.6.egg\*.*
<FreeCAD program folder>\bin\Lib\site-packages\xlutils-2.0.0-py3.6.egg\*.*
<FreeCAD program folder>\bin\Lib\site-packages\xlwt-1.3.0-py3.6.egg\*.*
User avatar
johnwang
Veteran
Posts: 1382
Joined: Sun Jan 27, 2019 12:41 am

Re: Plug-in for AUTODESK Inventor files

Post by johnwang »

Roy_043 wrote: Wed May 20, 2020 1:15 pm The only solution that I could find is to copy the dependencies from the FreeCAD V0.19 program folder:
I tried this plugin before, not really want to install it on both version of FCs. Now I just try to avoid using addonmanager. Alway install plugin manually.
hfc series CAE workbenches for FreeCAD (hfcNastran95, hfcMystran, hfcFrame3DD, hfcSU2 and more)
User avatar
Roy_043
Veteran
Posts: 8539
Joined: Thu Dec 27, 2018 12:28 pm

Re: Plug-in for AUTODESK Inventor files

Post by Roy_043 »

Another test file: Primitives_test.dxf.

Error:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\<username>\AppData\Roaming\FreeCAD\Mod\InventorLoader\importerIL.py", line 124, in open
reader.create3dModel(None , doc)
File "C:\Users\<username>\AppData\Roaming\FreeCAD\Mod\InventorLoader\importerDXF.py", line 45, in create3dModel
importModel(group)
File "C:\Users\<username>\AppData\Roaming\FreeCAD\Mod\InventorLoader\importerSAT.py", line 146, in importModel
bodies = _resolveNodes(acis)
File "C:\Users\<username>\AppData\Roaming\FreeCAD\Mod\InventorLoader\importerSAT.py", line 133, in _resolveNodes
node = createNode(entity)
File "C:\Users\<username>\AppData\Roaming\FreeCAD\Mod\InventorLoader\Acis.py", line 289, in createNode
node.set(entity)
File "C:\Users\<username>\AppData\Roaming\FreeCAD\Mod\InventorLoader\Acis.py", line 2596, in set
i = self.setSubtype(entity.chunks, i)
File "C:\Users\<username>\AppData\Roaming\FreeCAD\Mod\InventorLoader\Acis.py", line 2704, in setSubtype
self.vrange, i = getInterval(chunks, i, MIN_INF, MAX_INF, getScale())
File "C:\Users\<username>\AppData\Roaming\FreeCAD\Mod\InventorLoader\Acis.py", line 453, in getInterval
upper, i = getRange(chunks, i, defMax, scale)
File "C:\Users\<username>\AppData\Roaming\FreeCAD\Mod\InventorLoader\Acis.py", line 442, in getRange
type, i = getEnumByTag(chunks, index, RANGE)
File "C:\Users\<username>\AppData\Roaming\FreeCAD\Mod\InventorLoader\Acis.py", line 388, in getEnumByTag
chunk = chunks[index]
<class 'IndexError'>: list index out of range
Attachments
Primitives_test.png
Primitives_test.png (17.28 KiB) Viewed 2192 times
Primitives_test.dxf
(52.3 KiB) Downloaded 75 times
Post Reply