Help with StepUp - python error?

I’ve been trying to setup the StepUp modules to export step files from FreeCad. I have FreeCad 0.17 installed on a Windows10 machine, and installed StepUp workbench through the add-on manager. I have updated my config file to match the 2 folders I am using. I have been able to pull in my footprints, align component models and export the step/wrl files without issue. When I try to pull in a PCB file though, I’m getting this error:

Running the Python command ‘ksuToolsOpenBoard’ failed:
Traceback (most recent call last):
File “C:\Users\Caleb Hunt\AppData\Roaming\FreeCAD\Mod\kicadStepUpMod\kicadStepUpCMD.py”, line 103, in Activated
kicadStepUptools.onLoadBoard()
File “C:\Users\Caleb Hunt\AppData\Roaming\FreeCAD\Mod\kicadStepUpMod\kicadStepUptools.py”, line 6926, in onLoadBoard
mypcb = KicadPCB.load(name) #test parser
File “C:\Users\Caleb Hunt\AppData\Roaming\FreeCAD\Mod\kicadStepUpMod\kicadStepUptools.py”, line 1485, in load
return KicadPCB(parseSexp(f.read()))
File “C:\Users\Caleb Hunt\AppData\Roaming\FreeCAD\Mod\kicadStepUpMod\kicadStepUptools.py”, line 1365, in parseSexp
assert stack, “Trouble with nesting of brackets”

Trouble with nesting of brackets

I appreciate any help!!

Thank you,
Caleb

Does the board open in kicad without problems? (As the error is reported by the kicad file parser there might be a problem in the board file.)


I sometimes get a python exception with stepup. Until now simply importing it again fixed everything up. (So either there is some sort of raise condition or the order of some operations is not quite right.)

When importing a footprint make sure you have a project open.

@maui do you have anything to add?

1 Like

Thank you for your reply, Rene_Poschl. The board seems to open without issue in KiCad, I should have included that in my original post.

Does the stepup created .step and .wrl filename have to match the KiCad footprint name exactly or anything critical that I might have missed in the setup guide? Or do I just need to make sure that I have attached the correct .wrl file to the footprintin KiCad?

Thanks for the help!
Caleb

You can call your .step or .wrl files as you wish.

Exactly. Tell the foorprint the path to your .step and .wrl files, that’s all.

1 Like

Hi @drawing_lines
it seems the kicad_pcb parser is getting an issue…
Does your board use kicad official footprints or it is using different sources (i.e. SparkFun)?

Could you please send me the kicad_pcb file in PM to see what is the issue?

I remember I had a similar issue once… I need to see if I can recall it…
Maurice

2 Likes

I’ve gotten some of them from Digikey/UltraLibarian. I can’t figure out how to send a PM to send you the file

@drawing_lines
Click on the user, when the profile comes up, click on message
send-message

and then create a new message
send-message-2

New users might not be allowed to initiate the sending of a private message. So easiest option might be you send one to him such that he can answer.

1 Like

Thanks @Rene_Poschl ,
I’m going to…
M

Hi @drawing_lines
I made a small update that should improve compatibility with non official footprint sources…
please have a try updating the StepUp WB from FreeCAD

1 Like

Just updated… It’s working!! Thank you so much! Can I somehow buy you a beer?

Happy it is working! :beers:

OK, so I’ve gotten it almost working, but I can’t seem to point the ksu-config.ini file to the correct folder for my step/wrl files. Here’s the error… Can you help me with this last issue?
image

Any chance someone can see what I’m doing wrong?

Thank you!
Caleb

So I copied my kicad_pcb file over to the same folder where I have my models, and it seems to have worked… Seems to be adding the board folder location as a prefix to the folder I had entered in the .ini file?

Thank you,
Caleb

Hi @drawing_lines
from the Cheat Sheet

  1. Configure StepUp tools
    To use StepUp tools for converting a kicad_pcb Board to a mechanical STEP model you just need to edit ‘ksu-config.ini’ 3D prefix path assigning it to your KISYS3DMOD value,
    ‘ksu-config.ini’ file is in %Homepath% (Win) or $HOME (OSX & Linux) folder.

and from the ini file:

[prefix3D]
prefix3d_1 = c:\program files\kicad\share\kicad\modules\packages3d
prefix3d_2 = c:\extra_packages3d
;; put here your kisys3dmod path or 3d model prefix path or 3d alias
;; only two prefixs are allowed; must finish with slash or backslash
;prefix3d_1 = c:\program files\kicad\share\kicad\modules\packages3d
;prefix3d_1 = kicad/share/modules/packages3d/
;prefix3d_2 = c:\extra_packages3d\

  1. Which is your ${KISYS3DMOD} prefix for Kicad?
  2. Do you have a separate library for extra 3D models? Which is its prefix?

Configure your paths in the config file and you should be fine…

I believe I did it correctly. Here are the 2 lines in the .ini file:

prefix3D_1 = C:\Program Files\KiCad\share\kicad\modules\packages3d
prefix3D_2 = C:\Users\Caleb Hunt\Documents\Design Files\CAD Library\

I verified that both are the correct folder locations. The error seems indicate that the root directory from where the kicad_pcb file is located is being included in the prefix (C:\Users\Caleb Hunt\Documents\Design Files\Cineo\Daughter Board\Cineo Daughter Board)?

When I copy the kicad_pcb file into my folder C:\Users\Caleb Hunt\Documents\Design Files\CAD Library\ and run stepup from that file, it seems to work without issue. But if I run it from the original folder location listed above, it is giving me the errors. At least I have a work-around.

Thank you!
Caleb

but have you defined those path also on kicad?
from the file you sent me I can see:

  1. (model ${KISYS3DMOD}/Connectors_Molex.3dshapes/Molex_PicoBlade_53261-1771_17x1.25mm_Angled.wrl
    So I imagine you should have this folder setup:
    C:\Program Files\KiCad\share\kicad\modules\packages3d\Connectors_Molex.3dshapes\Molex_PicoBlade_53261-1771_17x1.25mm_Angled.wrl
  2. (model "../../../../../../Users/Caleb Hunt/Documents/Design Files/CAD Library/TE #8-188275-6_FINAL.wrl"
    then it seems you haven’t configured a secondary 3D folder (Alias) in KiCad ‘Paths’ like in your case something like:
    CADLibrary C:\Users\Caleb Hunt\Documents\Design Files\CAD Library\

I didn’t realize I had to do it in KiCad to match, that makes sense!

Let me try again :slight_smile:

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