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!
Post Reply
Buddy Hy
Posts: 32
Joined: Sat Aug 31, 2019 11:30 am

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

Post by Buddy Hy »

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 44 times
User avatar
wandererfan
Veteran
Posts: 6326
Joined: Tue Nov 06, 2012 5:42 pm
Contact:

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

Post by wandererfan »

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: 32
Joined: Sat Aug 31, 2019 11:30 am

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

Post by Buddy Hy »

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

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

Post by chrisb »

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

I hope you agree.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
vocx
Veteran
Posts: 5197
Joined: Thu Oct 18, 2018 9:18 pm

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

Post by vocx »

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.
Always add the important information to your posts if you need help. Also see Tutorials and Video tutorials.
To support the documentation effort, and code development, your donation is appreciated: liberapay.com/FreeCAD.
Post Reply