Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIX: Add Try/Catch to prevent Failures on Imports #166

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

AccidentallyTheCable
Copy link

These properties (Specifically in copy_objs) were causing my kicad imports to fail because these properties did not exist.

I wrapped them in try/catch and was able to successfully import my board. I did try/catches around others to prevent other potential failures as well, though I didnt want to go too overboard.

@easyw
Copy link
Owner

easyw commented Mar 20, 2023

@AccidentallyTheCable
would you mind to attach a failing sample file?
thanks for your contribution

@AccidentallyTheCable
Copy link
Author

Im not really comfortable with doing that because the boards are not part of a public project. Theres also a high probability it wouldnt load properly anyway given the custom kicad footprints and whatnot.

Kicad Version

Application: KiCad (64-bit)

Version: (6.0.5), release build

Libraries:
wxWidgets 3.1.5
libcurl/7.82.0-DEV Schannel zlib/1.2.12

Platform: Windows 10 (build 19045), 64-bit edition, 64 bit, Little endian, wxMSW

Build Info:
Date: May 3 2022 00:36:16
wxWidgets: 3.1.5 (wchar_t,wx containers)
Boost: 1.79.0
OCC: 7.6.0
Curl: 7.82.0-DEV
ngspice: 36
Compiler: Visual C++ 1929 without C++ ABI

Build settings:
KICAD_USE_OCC=ON
KICAD_SPICE=ON

Freecad Version

OS: Windows 10 Version 2009
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.24276 (Git)
Build type: Release
Branch: releases/FreeCAD-0-19
Hash: a88db11e0a908f6e38f92bfc5187b13ebe470438
Python version: 3.8.6+
Qt version: 5.15.1
Coin version: 4.0.1
OCC version: 7.5.0
Locale: English/United States (en_US)

@easyw
Copy link
Owner

easyw commented Mar 21, 2023

@AccidentallyTheCable
would you please provide the full error logs written in the FC report panel?
from there you probably could discover which STEP model is causing the issue and we could solve the problem without skipping it with a try except procedure...
I would be interested in find why a STEP model is missing some of these attributes...

@AccidentallyTheCable
Copy link
Author

@easyw my bad I dont know why I didnt think of that. Ive attached the log from freecad start to import failure, the stp model, as well as the kicad_mod file.

import-logs.zip

@easyw
Copy link
Owner

easyw commented Mar 22, 2023

@AccidentallyTheCable
thanks for the log and stp file...
would you please attach also:

  • FC STEP import settings image
  • FC kSU import settings image
    would your kSU be the latest release?

@easyw
Copy link
Owner

easyw commented Mar 22, 2023

@AccidentallyTheCable
I also noticed your FC version is not the latest stable release...
Could you try with FC 0.20.2?
https://github.com/FreeCAD/FreeCAD-Bundle/releases
I cannot reproduce your issue even on FC 0.19.4

@AccidentallyTheCable
Copy link
Author

@easyw Id be happy to give it a try, but even if it cannot be reproduced, these should still have some kind of checking around it. either hasattr(..) or try/catch. Im currently a bit hesitant to do an upgrade because the last FC upgrade broke a lot of things for my projects.

@easyw
Copy link
Owner

easyw commented Mar 25, 2023

the strange thing is that a FC shape should always has those color properties...
You could try w FC 0.19.3 or 0.19.4
BTW in win you can simply have many FC releases on the same PC just to test ...

@easyw
Copy link
Owner

easyw commented Mar 26, 2023

Extracting from FC installer:
You can use 7zip to unzip also the '.exe' file and obtain the same of the '.7z' version (a portable version).
image

https://forum.freecad.org/viewtopic.php?p=226636#p226636

@AccidentallyTheCable
Copy link
Author

AccidentallyTheCable commented Mar 31, 2023

I ended up upgrading FC because of problems with Asm4 as well, and this problem still occurs.

Something that may be worth noting, the board has many of these components on it (17 of them, and 16 of them are located in hierarchical sheets within kicad). When loading the board with KicadStepUp, the first one loads as a black color, but then all others load as a gray color. Im not sure if that has anything to do with this, but it seemed in the same 'problem' area of not being able to set colors.

@easyw
Copy link
Owner

easyw commented Apr 2, 2023

I ended up upgrading FC because of problems with Asm4 as well, and this problem still occurs.

that's very strange... it could be a video driver issue...
just as last try and info could you please post your:

  • FC STEP import settings image
  • FC kSU import settings image

@AccidentallyTheCable
Copy link
Author

Managed to finally get this working, after a complete uninstall and reinstall of everything. I still strongly suggest wrapping those calls in try/catch or hasattr calls

@luzpaz
Copy link
Contributor

luzpaz commented Nov 2, 2023

Any progress here ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants