KiCADStepUp load board failed [solved]

Here is the report log:
19:31:58 PoM not present
19:31:58 using ‘Part’ container and ‘Links’
19:31:58 kicad_parser_version 2.1.3
19:31:58 FC Version 019-24267
19:31:58 kicad StepUp version 10.1.8.5
19:31:58 tolerance on vertex applied
19:31:58 applying Materials to Shapes
19:31:58 your home path is C:\Users\xzf16
19:31:58 export to STEP False
19:31:58 Tabified done !
19:31:58 done!
19:32:04 opening C:/Users/Public/Documents/Altium/pcb100014-Chery-gbcs/PCB100014 Chery GBCS.kicad_pcb
19:32:04 my file path C:\Users\Public\Documents\Altium\pcb100014-Chery-gbcs
19:32:05 Running the Python command ‘ksuToolsOpenBoard’ failed:
Traceback (most recent call last):
File “C:\Users\xzf16\AppData\Roaming\FreeCAD\Mod\kicadStepUpMod\kicadStepUpCMD.py”, line 843, in Activated
kicadStepUptools.onLoadBoard()
File “C:\Users\xzf16\AppData\Roaming\FreeCAD\Mod\kicadStepUpMod\kicadStepUptools.py”, line 6750, in onLoadBoard
mypcb = KicadPCB.load(name) #test parser
File “C:\Users\xzf16\AppData\Roaming\FreeCAD\Mod\kicadStepUpMod\fcad_parser\kicad_pcb.py”, line 92, in load
return KicadPCB(parseSexp(f.read()))

‘gbk’ codec can’t decode byte 0xae in position 5490: illegal multibyte sequence

@xzf16
would you mind to try to change the following file:
C:\Users\xzf16\AppData\Roaming\FreeCAD\Mod\kicadStepUpMod\fcad_parser\kicad_pcb.py
with the one I’ve attached?
kicad_pcb.zip (1.0 KB)

and would you please post your KISYS3DMOD path?

Hi, I have used the file you attached, but when I pressed load file button, an error message occurred:
21:36:23 KiCadStepUpWB.Activated(v 10.8.9)
21:36:26 PoM not present
21:36:26 using ‘Part’ container and ‘Links’
21:36:26 Running the Python command ‘ksuToolsOpenBoard’ failed:
Traceback (most recent call last):
File “C:\Users\xzf16\AppData\Roaming\FreeCAD\Mod\kicadStepUpMod\kicadStepUpCMD.py”, line 836, in Activated
import kicadStepUptools
File “C:\Program Files\FreeCAD 0.19\bin\Lib\site-packages\shiboken2\files.dir\shibokensupport_feature_.py”, line 142, in import
return original_import(name, *args, **kwargs)
File “C:\Users\xzf16\AppData\Roaming\FreeCAD\Mod\kicadStepUpMod\kicadStepUptools.py”, line 790, in
import fcad_parser
File "C:\Program Files\FreeCAD 0.19\bin\Lib\site-packages\shiboken2\files.dir\shibokensupport_feature
.py", line 142, in import
return original_import(name, *args, **kwargs)
File "C:\Users\xzf16\AppData\Roaming\FreeCAD\Mod\kicadStepUpMod\fcad_parser_init
.py", line 1, in
from .kicad_pcb import *
File “C:\Program Files\FreeCAD 0.19\bin\Lib\site-packages\shiboken2\files.dir\shibokensupport_feature_.py”, line 142, in _import
return original_import(name, *args, **kwargs)

No module named 'fcad_parser.kicad_pcb’PoM not present
21:36:32 using ‘Part’ container and ‘Links’
21:36:32 Running the Python command ‘ksuToolsOpenBoard’ failed:
Traceback (most recent call last):
File “C:\Users\xzf16\AppData\Roaming\FreeCAD\Mod\kicadStepUpMod\kicadStepUpCMD.py”, line 836, in Activated
import kicadStepUptools
File “C:\Program Files\FreeCAD 0.19\bin\Lib\site-packages\shiboken2\files.dir\shibokensupport_feature_.py”, line 142, in import
return original_import(name, *args, **kwargs)
File “C:\Users\xzf16\AppData\Roaming\FreeCAD\Mod\kicadStepUpMod\kicadStepUptools.py”, line 790, in
import fcad_parser
File "C:\Program Files\FreeCAD 0.19\bin\Lib\site-packages\shiboken2\files.dir\shibokensupport_feature
.py", line 142, in import
return original_import(name, *args, **kwargs)
File "C:\Users\xzf16\AppData\Roaming\FreeCAD\Mod\kicadStepUpMod\fcad_parser_init
.py", line 1, in
from .kicad_pcb import *
File “C:\Program Files\FreeCAD 0.19\bin\Lib\site-packages\shiboken2\files.dir\shibokensupport_feature_.py”, line 142, in _import
return original_import(name, *args, **kwargs)

No module named 'fcad_parser.kicad_pcb’PoM not present
21:36:33 using ‘Part’ container and ‘Links’
21:36:33 Running the Python command ‘ksuToolsOpenBoard’ failed:
Traceback (most recent call last):
File “C:\Users\xzf16\AppData\Roaming\FreeCAD\Mod\kicadStepUpMod\kicadStepUpCMD.py”, line 836, in Activated
import kicadStepUptools
File “C:\Program Files\FreeCAD 0.19\bin\Lib\site-packages\shiboken2\files.dir\shibokensupport_feature_.py”, line 142, in import
return original_import(name, *args, **kwargs)
File “C:\Users\xzf16\AppData\Roaming\FreeCAD\Mod\kicadStepUpMod\kicadStepUptools.py”, line 790, in
import fcad_parser
File "C:\Program Files\FreeCAD 0.19\bin\Lib\site-packages\shiboken2\files.dir\shibokensupport_feature
.py", line 142, in import
return original_import(name, *args, **kwargs)
File "C:\Users\xzf16\AppData\Roaming\FreeCAD\Mod\kicadStepUpMod\fcad_parser_init
.py", line 1, in
from .kicad_pcb import *
File “C:\Program Files\FreeCAD 0.19\bin\Lib\site-packages\shiboken2\files.dir\shibokensupport_feature_.py”, line 142, in _import
return original_import(name, *args, **kwargs)

No module named ‘fcad_parser.kicad_pcb’

The KISYS3DMOD path is:
C:/Program Files/KiCad/share/kicad/modules/packages3d

And I don’t think this is a setting issue, because I can load the other board which is in the same folder and created with the same version of the KiCAD sucessfully, only the file I sent to you can’t be loaded sucessfully.

have you swapped/exchanged the original file C:\Users\xzf16\AppData\Roaming\FreeCAD\Mod\kicadStepUpMod\fcad_parser\kicad_pcb.py
with the one kicad_pcb.py inside the kicad_pcb.zip file?
the above errors are quite strange…

Yes, I do.
First I back up The original py file and then copy The file you attached to The path.

Would you mind to connect to my computer to have a remote debug on my computer tomorrow evening(Chinese local time)?

But which remote tool you can support is a question.

@xzf16
would you mind to test this branch?
kicadStepUpMod utf-8 branch
(just delete the content of your kicadStepUpMod folder in C:\Users\xzf16\AppData\Roaming\FreeCAD\Mod directory and substitute it with the content of the zipped archive [inside the kicadStepUpMod-4680acd94c2f06b38719ab53cafa6ad4605ff88d folder])

Hi,

After I used utf-8 branch, now it works properly.

Thank you very much.

But a question here , why not using the UTF-8 branch as the main branch?

thanks for the feedback :slight_smile:

the utf-8 branch has been just created to test your issue :wink:
it will be in the main code later in the day, after your positive feedback :smiley:

2 Likes

That’s very great, Thanks very much for your great support again.

1 Like

you are welcome!
Maurice

1 Like

Hi, another issue has appeared.

Recentely, I update KiCAD to version 6.0 RC2, and then save the same PCB file to version 6.0 format, and I reload the board into freecad, the board can be appeared in the main window, but in the report explorer, it reports a failed message:

.
Here is the Kicad version info:

Application: KiCad (64-bit)
Version: (6.0.0-rc2-16-g160328abc7), release build
Libraries:
wxWidgets 3.1.5
libcurl/7.78.0-DEV Schannel zlib/1.2.11
Platform: Windows 10 (build 18363), 64-bit edition, 64 bit, Little endian, wxMSW
Build Info:
Date: Dec 20 2021 21:00:55
wxWidgets: 3.1.5 (wchar_t,wx containers)
Boost: 1.76.0
OCC: 7.5.0
Curl: 7.78.0-DEV
ngspice: 35
Compiler: Visual C++ 1929 without C++ ABI
Build settings:
KICAD_USE_OCC=ON
KICAD_SPICE=ON

Here is the entire message of freecad(I ignored a lot of message in the middle because the total count of words are limited by the forum):

09:19:59 PoM not present
09:19:59 using ‘LinkGroups’ and ‘Links’
09:19:59 kicad_parser_version 2.1.3
09:19:59 FC Version 019-24267
09:19:59 kicad StepUp version 10.1.8.7
09:19:59 tolerance on vertex applied
09:19:59 applying Materials to Shapes
09:19:59 your home path is C:\Users\xzf16
09:19:59 export to STEP False
09:19:59 Tabified done !
09:19:59 done!
09:20:02 opening C:/Users/Public/Documents/Altium/pcb100014-Chery-gbcs/PCB100014 Chery GBCS.kicad_pcb
09:20:02 my file path C:\Users\Public\Documents\Altium\pcb100014-Chery-gbcs
09:20:02 grid origin found @ (-84.193963, 47.427825)
09:20:02 PCB Loader
09:20:02 pcb thickness 1.6mm
09:20:02 kicad_pcb version 20211014
09:20:02 parsing
09:20:02 17 edge segments
09:20:02 aux_axis_origin[84.193963, 47.427825]
09:20:02 grid_origin[84.193963, 47.427825]
09:20:02 parsing&building time 0.011
09:20:02 start adding constraints to pcb sketch
09:20:02 using constrainator
09:20:02 check to sanitize
09:20:02 adding constraints time 0.007
09:20:02 created PCB face w/ edge tolerance -> 0.01 mm
09:20:02 running time: 1.177sec
09:20:02 start cutting
09:20:02 using hierarchy container
09:20:02 generating flat holes
09:20:02 cutting time 0.031
09:20:02 pcb dimensions: (83.94;82.53;1.60)
09:20:02 running time: 1.433sec
09:20:02 FC Version 019-24267
09:20:02 creating hierarchy
09:20:02 placing board @ -84.193963,47.427825
09:20:02 building up pcb time 1.434
09:20:03 running time: 1.911sec
09:20:03 VBO status True
09:20:03 disabling VBO
09:20:03 ReadShapeCompoundMode status True
09:20:03 “${KISYS3DMOD}/Capacitor_SMD.3dshapes/C_0603_1608Metric.wrl”
09:20:03 adjusting Local Path
09:20:03 step-module-replaced Capacitor_SMD.3dshapes/C_0603_1608Metric.wrl
09:20:03 model name C_0603_1608Metric
09:20:03 opening C:/Program Files/KiCad/share/kicad/modules/packages3d\Capacitor_SMD.3dshapes/C_0603_1608Metric.step
09:20:03 C_0603_1608Metric
09:20:03 module Capacitor_SMD.3dshapes/C_0603_1608Metric.stpZ
09:20:03 added 1 model(s)
09:20:03 “${KISYS3DMOD}/Capacitor_SMD.3dshapes/C_0603_1608Metric.wrl”
09:20:03 adjusting Local Path
09:20:03 step-module-replaced Capacitor_SMD.3dshapes/C_0603_1608Metric.wrl
09:20:03 model name C_0603_1608Metric
09:20:03 opening C:/Program Files/KiCad/share/kicad/modules/packages3d\Capacitor_SMD.3dshapes/C_0603_1608Metric.step

“${KISYS3DMOD}/Connector_PinHeader_2.54mm.3dshapes/PinHeader_1x03_P2.54mm_Vertical.wrl”
09:20:35 adjusting Local Path
09:20:35 step-module-replaced Connector_PinHeader_2.54mm.3dshapes/PinHeader_1x03_P2.54mm_Vertical.wrl
09:20:35 model name PinHeader_1x03_P2.54mm_Vertical
09:20:35 opening C:/Program Files/KiCad/share/kicad/modules/packages3d\Connector_PinHeader_2.54mm.3dshapes/PinHeader_1x03_P2.54mm_Vertical.step
09:20:35 PinHeader_1x03_P2.54mm_Vertical
09:20:35 module Connector_PinHeader_2.54mm.3dshapes/PinHeader_1x03_P2.54mm_Vertical.stpZ
09:20:35 added 134 model(s)
09:20:35 “${KISYS3DMOD}/Connector_PinHeader_2.54mm.3dshapes/PinHeader_1x03_P2.54mm_Vertical.wrl”
09:20:35 adjusting Local Path
09:20:35 step-module-replaced Connector_PinHeader_2.54mm.3dshapes/PinHeader_1x03_P2.54mm_Vertical.wrl
09:20:35 model name PinHeader_1x03_P2.54mm_Vertical
09:20:35 opening C:/Program Files/KiCad/share/kicad/modules/packages3d\Connector_PinHeader_2.54mm.3dshapes/PinHeader_1x03_P2.54mm_Vertical.step
09:20:35 PinHeader_1x03_P2.54mm_Vertical
09:20:35 copying from cache
09:20:35 module Connector_PinHeader_2.54mm.3dshapes/PinHeader_1x03_P2.54mm_Vertical.stpZ
09:20:35 added 135 model(s)
09:20:35 running time: 35.089sec
09:20:35 enabling VBO
09:20:35 info message
09:20:35 Board Placed @ -84.19;47.43;0.0
09:20:35 kicad pcb pos: (64.62;-58.05;0.00)
09:20:35 pcb dimensions: (83.94;82.53;1.60)
09:20:36 thread ViewFitting
09:20:39 Running the Python command ‘ksuToolsOpenBoard’ failed:
Traceback (most recent call last):
File “C:\Users\xzf16\AppData\Roaming\FreeCAD\Mod\kicadStepUpMod\kicadStepUpCMD.py”, line 843, in Activated
kicadStepUptools.onLoadBoard()
File “C:\Users\xzf16\AppData\Roaming\FreeCAD\Mod\kicadStepUpMod\kicadStepUptools.py”, line 7160, in onLoadBoard
Display_info(blacklisted_model_elements)
File “C:\Users\xzf16\AppData\Roaming\FreeCAD\Mod\kicadStepUpMod\kicadStepUptools.py”, line 3554, in Display_info
single_color=FreeCADGui.ActiveDocument.getObject(obj.Name).DiffuseColor
‘Gui.ViewProviderDocumentObject’ object has no attribute ‘DiffuseColor’

And here is the freecad version:

OS: Windows 10 Version 1909
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.24267 +99 (Git)
Build type: Release
Branch: Branch_0.19.3
Hash: 6530e364184ce05ccff39501e175cf2237e6ee4b
Python version: 3.8.6+
Qt version: 5.15.2
Coin version: 4.0.1
OCC version: 7.5.3
Locale: English/United States (en_US)

If you want the source file of PCB, I can send you through PM also, but you can also using the PCB file I sent to you before like this:
Install the lastest version of KiCAD 6 RC2, and open the PCB file and save it into 6.0 version format, and load it to freecad.
Maybe then you will get the same result as mine.

@xzf16
it seems you have enabled the “Start Turntable after loading” option…
this option has a small bug (since long time)… it seems it is very rarely used

I’m going to fix it asap

If you uncheck this option, your board will be loaded just fine

1 Like

Yes, after I disable the ‘Start Turntable’ option, it works fine.

Thank you.

And I have another question, after I loaded the PCB file into freecad, if I do some modification in the KiCAD for the PCB file, how can I update the the change to the FreeCAD? I haven’t seen any update/refresh/synchronization button in the KiCADStepUp WB.

from the kicadStepUp-cheat-sheet you can push & pull pcb edge from FC sketcher

Hi Maui,

Maybe you misunderstood what I mean.

I mean, if I do a modification for the PCB file in the KiCAD, for example, I move a component from one place to another place, and then want to check whether the movement has a conflict to the housing or not in the FreeCAD, what shoud I do next? Press the ‘Load KiCAD board file’ button and choose the PCB board to load it again? But if I want to check the conflict after each movment, maybe these steps will cost much time. It’s great if we can have a re-load button or refresh button or update button, when I have a movement, I just need to press this button once and the loaded PCB in the FreeCAD will be updated automaticly.

And I think KiCAD also need this button to update the PCB file from FreeCAD simply instead of close the file and reopen it.

This is only a small suggention.

from the kicadStepUp-cheat-sheet
and ECAD-MCAD-collaboration
you can push & pull footprint placement from 3D model position

https://forum.kicad.info/t/kicad-stepup-a-seamless-ecad-mcad

All the pdf docs are available at the FC StepUp WB Menu

Oh, I haven’t see this video before, it’s so cool.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.