Assembly 4 workbench

Discussion about the development of the Assembly workbench.
User avatar
Zolko
Posts: 257
Joined: Mon Dec 17, 2018 10:02 am

Re: Assembly 4 workbench

Postby Zolko » Wed Jul 17, 2019 7:55 am

Zolko wrote:
Wed Jul 17, 2019 7:21 am
dan-miel wrote:
Wed Jul 17, 2019 5:31 am

During initialization the error "'charmap' codec can't decode byte 0x90 in position 1510: character maps to <undefined>" occurred in C:\Users\Dan\AppData\Roaming\FreeCAD\Mod\Mod_Asm4\InitGui.py
Please look into the log file for further information
that's a Windows/Python/Unicode error.
may-be this can help :

https://www.quora.com/Why-doesnt-Micros ... Windows-10
Windows 10 does support UTF-8 as a code page, but internally it uses UTF-16 and Microsoft continues to recommend UTF-16 for new applications.

Why? Because UTF-8 simply did not exist when Windows NT was first created...
... 25 years ago. And Microsoft didn't manage to transition from UTF16 to UTF8 in 25 years. All other operating systems have made the move, except Microsoft.
dan-miel
Posts: 61
Joined: Thu Sep 13, 2018 12:29 am
Location: Spokane WA. USA

Re: Assembly 4 workbench

Postby dan-miel » Wed Jul 17, 2019 4:30 pm

Zolko.
Zolko wrote:
Wed Jul 17, 2019 7:21 am
Can you please try to replace the InitGui.py file in Mod_Asm4 with the one attached ? I use some nice frames for comments in my code, in the attached one I removed them:

Code: Select all"""
╔═══════════════════════════════════════════════╗
║ Initialize the workbench ║
╚═══════════════════════════════════════════════╝
"""
I loaded the file you sent and received this error: During initialization the error "invalid character in identifier (<string>, line 1)" occurred in C:\Users\dan-m\AppData\Roaming\FreeCAD\Mod\sheetmetal\InitGui.py
I opened the file in NotePad++ and in the lower right it said it had been saved in UTF-8-BOM. I saved it in UTF-8 and it ran with Assy4 in the dropdown. If I added any characters from your border it would give the older error with the position number changing, depending on where I put the character.
This was fine but Assembly4 runs on other Windows machines so I looked further.

Here is a fix for "'charmap' codec can't decode" in Windows 10
I found a setting in the Control Panel that lets my machines work using you original files.
Click Region
Click Tab at top with "Administrative"
Click "Change system locale"
(A picture is attached below.)
Click the checkmark beside Beta: Use UTF-8 for worldwide language support
Click OK
Assembly 4 now shows in the dropdowns.

Thanks for your time.
Dan Miel
Edited
I just tried to open some files and I have more errors. I have to look at it later.
Dan
Attachments
Checkmark.JPG
Checkmark.JPG (26.25 KiB) Viewed 501 times
UTF.JPG
UTF.JPG (10.45 KiB) Viewed 501 times
UTF-8-BOM.jpg
UTF-8-BOM.jpg (3.1 KiB) Viewed 501 times
User avatar
Zolko
Posts: 257
Joined: Mon Dec 17, 2018 10:02 am

Re: Assembly 4 workbench

Postby Zolko » Thu Jul 18, 2019 6:15 am

dan-miel wrote:
Wed Jul 17, 2019 4:30 pm
I found a setting in the Control Panel that lets my machines work using you original files.
...
Assembly 4 now shows in the dropdowns.
well done

Edited : I just tried to open some files and I have more errors. I have to look at it later.
may-be you can try to delete the framed comments in the file that gives the error, to see if that helps ?

Anyway, I'll remove those frames and make an update to the workbench, to be on the safe side.

EDIT: I did make the change (v0.5.4).

Code: Select all

"""
    ╔═══════════════════════════════════════════════╗
    ║                  main class                   ║
    ╚═══════════════════════════════════════════════╝
"""
—vs—

Code: Select all

"""
    +-----------------------------------------------+
    |                  main class                   |
    +-----------------------------------------------+
"""
Not as fancy, but if it works ... Can you please download that version and see if it solves those errors ?
dan-miel
Posts: 61
Joined: Thu Sep 13, 2018 12:29 am
Location: Spokane WA. USA

Re: Assembly 4 workbench

Postby dan-miel » Thu Jul 18, 2019 2:40 pm

Zolko wrote:
Thu Jul 18, 2019 6:15 am
Not as fancy, but if it works ... Can you please download that version and see if it solves those errors ?
I downloaded and it worked. I opened the control panel and unchecked the box in the Region and it still worked.
I opened all three of the sample files and all of them opened and showed in the screen.
Good work.
I have tried to load your WB several times in the last six months with the same results. I'm surprised that this problem hasn't been reported before.

Before I leave, when I open the assemblies I get a report similar to the one below. Can I really ignore the enumeration and the PropShape?

Thanks again.
Dan

Enumeration index -1 is out of range, ignore it
Enumeration index -1 is out of range, ignore it
Enumeration index -1 is out of range, ignore it
Enumeration index -1 is out of range, ignore it
Enumeration index -1 is out of range, ignore it
<PropShape> PropertyTopoShape.cpp(324): Recomputation required for document 'Bielle' on geo element version change: 1.13.70200.3.0 -> 1.14.70200.3.0
<PropShape> PropertyTopoShape.cpp(324): Recomputation required for document 'Cuve' on geo element version change: 1.13.70200.3.0 -> 1.14.70200.3.0
<PropShape> PropertyTopoShape.cpp(324): Recomputation required for document 'Bague' on geo element version change: 1.13.70200.3.0 -> 1.14.70200.3.0
<PropShape> PropertyTopoShape.cpp(324): Recomputation required for document 'Screw_CHC' on geo element version change: 1.13.70200.3.0 -> 1.14.70200.3.0
User avatar
Zolko
Posts: 257
Joined: Mon Dec 17, 2018 10:02 am

Re: Assembly 4 workbench

Postby Zolko » Thu Jul 18, 2019 3:13 pm

dan-miel wrote:
Thu Jul 18, 2019 2:40 pm
I downloaded and it worked. I opened the control panel and unchecked the box in the Region and it still worked. I opened all three of the sample files and all of them opened and showed in the screen.
nice, thank-you for testing

Before I leave, when I open the assemblies I get a report similar to the one below. Can I really ignore the enumeration and the PropShape?
I hope so, because that's what I do. Cheers
mfasano
Posts: 31
Joined: Wed Apr 11, 2018 12:31 pm

Re: Assembly 4 workbench

Postby mfasano » Fri Jul 19, 2019 12:57 am

hello again;

I reinstalled assembly 4, and ran into the same problem that dan_liem had. You said put the WB in the mod directory of the standard Freecad; that worked for me, thanks.

I am trying to make a chain of rods, and it is not working for me. When I place the rods by matching the coordinate systems from the rods to ones in the parent assembly, the parts don't change position.

I can't match coordinate systems from parts. the place linked part dialog will not show the coordinate systems for a part if chosen when selecting the part as the attache parent. it will show he coordinate systems of the parent assembly.

Thanks,


OS: Windows 10
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.18.14369 (Git)
Build type: Release
Branch: (HEAD detached at FETCH_HEAD)
Hash: 45b39e8ff6861d15f4277f9759d012b41aae071f
Python version: 2.7.14
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.2.0
Locale: English/UnitedStates (en_US)

rod.FCStd
(12.9 KiB) Downloaded 5 times
pend2_1.FCStd
(6.15 KiB) Downloaded 4 times
User avatar
Zolko
Posts: 257
Joined: Mon Dec 17, 2018 10:02 am

Re: Assembly 4 workbench

Postby Zolko » Fri Jul 19, 2019 6:41 am

mfasano wrote:
Fri Jul 19, 2019 12:57 am
I am trying to make a chain of rods, and it is not working for me. When I place the rods by matching the coordinate systems from the rods to ones in the parent assembly, the parts don't change position.
yes, I saw that with your assembly. Then I made a new one (pend2_2) and that works.

pend2_2.png
pend2_2.png (320.86 KiB) Viewed 318 times
Python version: 2.7.14
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.2.0
ouh, bad, I'm not sure my code works with Python 2, and since it's deprecated I won't try. Do you have a way to test with the latest asm3 built ?
Attachments
pend2_2.FCStd
(10.55 KiB) Downloaded 5 times
mfasano
Posts: 31
Joined: Wed Apr 11, 2018 12:31 pm

Re: Assembly 4 workbench

Postby mfasano » Mon Jul 22, 2019 2:14 pm

pend4.FCStd
(5.15 KiB) Downloaded 1 time
I thinks I am getting close.

I get an error when I try to place link. It seems to be a QT error.

Code: Select all

Running the Python command 'placeLinkCmd' failed:
Traceback (most recent call last):
  File "C:\Users\fasa02\Documents\FreeCAD-asm3-Win64-Py3-Qt5-20190703\Mod\Mod_Asm4\placeLinkCmd.py", line 123, in Activated
    self.oldLCS = self.partLCSlist.findItems( self.old_linkLCS, QtCore.Qt.CaseSensitive )

'PySide2.QtWidgets.QListWidget.findItems' called with wrong argument types:
  PySide2.QtWidgets.QListWidget.findItems(str, CaseSensitivity)
Supported signatures:
  PySide2.QtWidgets.QListWidget.findItems(str, PySide2.QtCore.Qt.MatchFlags)
Thanks again;

OS: Windows 10 (10.0)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.17089 +1543 (Git)
Build type: Release
Branch: LinkStage3
Hash: 950c082111ae5ebeefb4dddc90a80dc9b54b2408
Python version: 3.6.8
Qt version: 5.12.1
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/United States (en_US)

Assembly 4 Workbench for FreeCAD-LinkStage3
v0.5.4 2019.07.18


rod.FCStd
(13.43 KiB) Downloaded 1 time
pend4.FCStd
(5.15 KiB) Downloaded 1 time
User avatar
Zolko
Posts: 257
Joined: Mon Dec 17, 2018 10:02 am

Re: Assembly 4 workbench

Postby Zolko » Mon Jul 22, 2019 3:23 pm

mfasano wrote:
Mon Jul 22, 2019 2:14 pm
I thinks I am getting close.
Those are obviously bugs, thank-you for your patience

Code: Select all

File "C:\Users\fasa02\Documents\FreeCAD-asm3-Win64-Py3-Qt5-20190703\Mod\Mod_Asm4\placeLinkCmd.py", line 123
Would you have the possibility to replace in that file the line 123 with:

Code: Select all

		self.oldLCS = self.partLCSlist.findItems( self.old_linkLCS, QtCore.Qt.CaseSensitive )
by
		self.oldLCS = self.partLCSlist.findItems( self.old_linkLCS, QtCore.Qt.MatchExactly )
and also line 149

Code: Select all

		self.oldLCS = self.attLCSlist.findItems( self.old_attLCS, QtCore.Qt.CaseSensitive )
by
		self.oldLCS = self.attLCSlist.findItems( self.old_attLCS, QtCore.Qt.MatchExactly )
If that works, I'll make a new release. (there is also the same in placeDatum.py)
mfasano
Posts: 31
Joined: Wed Apr 11, 2018 12:31 pm

Re: Assembly 4 workbench

Postby mfasano » Mon Jul 22, 2019 5:51 pm

Zolko wrote:
Mon Jul 22, 2019 3:23 pm



Would you have the possibility to replace in that file the line 123 with:

Code: Select all

		self.oldLCS = self.partLCSlist.findItems( self.old_linkLCS, QtCore.Qt.CaseSensitive )
by
		self.oldLCS = self.partLCSlist.findItems( self.old_linkLCS, QtCore.Qt.MatchExactly )
This fixes it.

Thanks.