Bug Report: Assembly 2 - Import a part from another FreeCAD document

Have some feature requests, feedback, cool stuff to share, or want to know where FreeCAD is going? This is the place.
Forum rules
Be nice to others! Read the FreeCAD code of conduct!
Buddy Hy
Posts: 31
Joined: Sat Aug 31, 2019 11:30 am

Bug Report: Assembly 2 - Import a part from another FreeCAD document

Postby Buddy Hy » Thu Sep 12, 2019 10:51 am

When trying to do this in a new document I get this error:

importing part from C:/Users/Lenovo Yoga/3D Objects/disc.FCStd
Running the Python command 'assembly2_importPart' failed:
Traceback (most recent call last):
File "C:\Users\Lenovo Yoga\AppData\Roaming\FreeCAD\Mod\assembly2\assembly2\importPart\__init__.py", line 152, in Activated
importedObject = importPart( filename )
File "C:\Users\Lenovo Yoga\AppData\Roaming\FreeCAD\Mod\assembly2\assembly2\importPart\__init__.py", line 39, in importPart
doc = Fcstd_File_Parser( filename )
File "C:\Users\Lenovo Yoga\AppData\Roaming\FreeCAD\Mod\assembly2\assembly2\importPart\fcstd_parser.py", line 79, in __init__
obj.Shape.importBrepFromString( z.open( shape_zip_name ).read() )

argument 1 must be str, not bytes

Nothing is imported.
Attachments
disc.FCStd
(8.2 KiB) Downloaded 10 times
wandererfan
Posts: 2989
Joined: Tue Nov 06, 2012 5:42 pm

Re: Bug Report: Assembly 2 - Import a part from another FreeCAD document

Postby wandererfan » Thu Sep 12, 2019 12:29 pm

Buddy Hy wrote:
Thu Sep 12, 2019 10:51 am
argument 1 must be str, not bytes
My understanding is that Assembly2 is no longer maintained and that A2plus_Workbench should be used instead.

The error message looks to be python2 style string handling in a python3 environment.
Buddy Hy
Posts: 31
Joined: Sat Aug 31, 2019 11:30 am

Re: Bug Report: Assembly 2 - Import a part from another FreeCAD document

Postby Buddy Hy » Thu Sep 12, 2019 9:56 pm

Thanks All, I'll give A2Plus a go.
chrisb
Posts: 18223
Joined: Tue Mar 17, 2015 9:14 am

Re: Bug Report: Assembly 2 - Import a part from another FreeCAD document

Postby chrisb » Fri Sep 13, 2019 6:01 am

I have moved some of the posts in this topic to a new one: State of Assembly2.

I hope you agree.
vocx
Posts: 1452
Joined: Thu Oct 18, 2018 9:18 pm

Re: Bug Report: Assembly 2 - Import a part from another FreeCAD document

Postby vocx » Fri Sep 13, 2019 7:58 am

chrisb wrote:
Fri Sep 13, 2019 6:01 am
I have moved some of the posts in this topic to a new one: State of Assembly2.

I hope you agree.
I don't agree with the split. The other posts give context as to why Assembly2 should be considered obsolete, and should not be used anymore. It provided an explanation as to why the error is probably in the string handling of Assembly2, and not in FreeCAD itself. A future user who finds this thread may not follow the link to that discussion.

Well, you provided a link to the other thread, so I guess it's fine.